aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ciimage/Dockerfile1
-rw-r--r--docs/markdown/Conference-presentations.md2
-rw-r--r--docs/markdown/Qt5-module.md14
-rw-r--r--docs/markdown/Reference-manual.md10
-rw-r--r--docs/markdown/Subprojects.md87
-rw-r--r--docs/markdown/snippets/if-found.md13
-rw-r--r--mesonbuild/backend/backends.py6
-rw-r--r--mesonbuild/backend/ninjabackend.py8
-rw-r--r--mesonbuild/build.py4
-rw-r--r--mesonbuild/compilers/compilers.py16
-rw-r--r--mesonbuild/dependencies/dev.py4
-rw-r--r--mesonbuild/dependencies/ui.py4
-rw-r--r--mesonbuild/environment.py2
-rw-r--r--mesonbuild/interpreter.py8
-rw-r--r--mesonbuild/interpreterbase.py5
-rw-r--r--mesonbuild/mconf.py4
-rw-r--r--mesonbuild/mesonlib.py45
-rw-r--r--mesonbuild/mesonmain.py6
-rw-r--r--mesonbuild/modules/qt.py28
-rw-r--r--mesonbuild/mparser.py8
-rwxr-xr-xrun_unittests.py2
-rw-r--r--test cases/common/125 shared module/meson.build2
-rw-r--r--test cases/common/126 llvm ir and assembly/meson.build2
-rw-r--r--test cases/common/16 configure file/config6.h.in19
-rw-r--r--test cases/common/16 configure file/meson.build11
-rw-r--r--test cases/common/16 configure file/prog6.c11
-rw-r--r--test cases/common/165 subdir if_found/meson.build11
-rw-r--r--test cases/common/165 subdir if_found/subdir/meson.build1
-rw-r--r--test cases/common/42 string operations/meson.build21
-rw-r--r--test cases/common/66 install subdir/subdir/meson.build2
-rw-r--r--test cases/common/68 number arithmetic/meson.build8
-rw-r--r--test cases/common/71 arithmetic bidmas/meson.build2
-rw-r--r--test cases/failing/65 grab sibling/subprojects/b/sneaky.c2
-rw-r--r--test cases/frameworks/4 qt/meson.build2
-rw-r--r--test cases/frameworks/4 qt/q5core.cpp18
-rw-r--r--test cases/frameworks/4 qt/qt4core_fr.ts12
-rw-r--r--test cases/frameworks/4 qt/qt5core_fr.ts12
-rw-r--r--test cases/linuxlike/1 pkg-config/meson.build2
-rw-r--r--test cases/osx/3 has function xcode8/meson.build8
39 files changed, 313 insertions, 110 deletions
diff --git a/ciimage/Dockerfile b/ciimage/Dockerfile
index a2e3433..05e679e 100644
--- a/ciimage/Dockerfile
+++ b/ciimage/Dockerfile
@@ -12,4 +12,5 @@ RUN apt-get -y update && apt-get -y upgrade \
&& apt-get -y install fpga-icestorm arachne-pnr yosys \
&& apt-get -y install gtk-sharp2 gtk-sharp2-gapi libglib2.0-cil-dev \
&& apt-get -y install libwmf-dev \
+&& apt-get -y install qt4-linguist-tools qttools5-dev-tools \
&& python3 -m pip install hotdoc codecov
diff --git a/docs/markdown/Conference-presentations.md b/docs/markdown/Conference-presentations.md
index 15e4396..abfc52f 100644
--- a/docs/markdown/Conference-presentations.md
+++ b/docs/markdown/Conference-presentations.md
@@ -8,7 +8,7 @@
- GStreamer conference 2015, [Done in 6.0 seconds](https://gstconf.ubicast.tv/videos/done-in-60-seconds-a-new-build-system-for-gstreamer) (jpakkane)
-- LCA 2016, [Builds, dependencies and deployment in the modern multiplatform world](https://www.youtube.com/watch?v=CTJtKtQ8R5k&feature=youtu.be) (jpakkane)
+- LCA 2016, [Builds, dependencies and deployment in the modern multiplatform world](https://www.youtube.com/watch?v=CTJtKtQ8R5k) (jpakkane)
- GUADEC 2016, [Making your GNOME app compile 2.4x faster](https://media.ccc.de/v/44-making_your_gnome_app_compile_24x_faster) (nirbheek)
diff --git a/docs/markdown/Qt5-module.md b/docs/markdown/Qt5-module.md
index aea2ae1..b5393a8 100644
--- a/docs/markdown/Qt5-module.md
+++ b/docs/markdown/Qt5-module.md
@@ -1,7 +1,7 @@
# Qt5 module
The Qt5 module provides tools to automatically deal with the various
-tools and steps required for Qt. The module has one method.
+tools and steps required for Qt. The module has two methods.
## preprocess
@@ -12,6 +12,14 @@ This method takes the following keyword arguments:
It returns an opaque object that should be passed to a main build target.
+## compile_translations (since v0.44.0)
+
+This method generates the necessary targets to build translation files with lrelease, it takes the following keyword arguments:
+ - `ts_files`, the list of input translation files produced by Qt's lupdate tool.
+ - `install` when true, this target is installed during the install step (optional).
+ - `install_dir` directory to install to (optional).
+ - `build_by_default` when set to true, to have this target be built by default, that is, when invoking plain ninja; the default value is false (optional).
+
A simple example would look like this:
```meson
@@ -21,6 +29,7 @@ inc = include_directories('includes')
moc_files = qt5.preprocess(moc_headers : 'myclass.h',
moc_extra_arguments: ['-DMAKES_MY_MOC_HEADER_COMPILE'],
include_directories: inc)
+translations = qt5.compile_translations(ts_files : 'myTranslation_fr.ts', build_by_default : true)
executable('myprog', 'main.cpp', 'myclass.cpp', moc_files,
include_directories: inc,
dependencies : qt5_dep)
@@ -28,5 +37,4 @@ executable('myprog', 'main.cpp', 'myclass.cpp', moc_files,
The 'modules' argument is used to include Qt modules in the project.
-See the Qt documentation for the [list of
-modules](http://doc.qt.io/qt-5/qtmodules.html).
+See the Qt documentation for the [list of modules](http://doc.qt.io/qt-5/qtmodules.html).
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index f64bded..424ab58 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -430,7 +430,7 @@ be passed to [shared and static libraries](#library).
`project`'s `default_options` overriding the values of these options
for this target only, since 0.40.0
- `d_import_dirs` list of directories to look in for string imports used
- in the D programmling language
+ in the D programming language
- `d_unittest`, when set to true, the D modules are compiled in debug mode
- `d_module_versions` list of module versions set when compiling D sources
@@ -1019,7 +1019,7 @@ has one argument the others don't have:
### subdir()
``` meson
- void subdir(dir_name)
+ void subdir(dir_name, ...)
```
Enters the specified subdirectory and executes the `meson.build` file
@@ -1032,6 +1032,12 @@ current build file and in all subsequent build files executed with
Note that this means that each `meson.build` file in a source tree can
and must only be executed once.
+This function has one keyword argument.
+
+ - `if_found` takes one or several dependency objects and will only
+ recurse in the subdir if they all return `true` when queried with
+ `.found()`
+
### subproject()
``` meson
diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md
index 923b6a3..14f01d4 100644
--- a/docs/markdown/Subprojects.md
+++ b/docs/markdown/Subprojects.md
@@ -4,69 +4,76 @@ short-description: Using meson projects as subprojects within other meson projec
# Subprojects
-Some platforms do not provide a native packaging system. In these cases it is common to bundle all third party libraries in your source tree. This is usually frowned upon because it makes it hard to add these kinds of projects into e.g. those Linux distributions that forbid bundled libraries.
-
-Meson tries to solve this problem by making it extremely easy to provide both at the same time. The way this is done is that Meson allows you to take any other Meson project and make it a part of your build without (in the best case) any changes to its Meson setup. It becomes a transparent part of the project. The basic idiom goes something like this.
+Some platforms do not provide a native packaging system. In these
+cases it is common to bundle all third party libraries in your source
+tree. This is usually frowned upon because it makes it hard to add
+these kinds of projects into e.g. those Linux distributions that
+forbid bundled libraries.
+
+Meson tries to solve this problem by making it extremely easy to
+provide both at the same time. The way this is done is that Meson
+allows you to take any other Meson project and make it a part of your
+build without (in the best case) any changes to its Meson setup. It
+becomes a transparent part of the project. The basic idiom goes
+something like this.
```meson
-dep = dependency('foo', required : false)
-if dep.found()
- # set up project using external dependency
-else
- subproject('foo')
- # set up rest of project as if foo was provided by this project
-endif
+dep = dependency('foo', fallback : [subproject_name, variable_name]
```
-All Meson features of the subproject, such as project options keep working and can be set in the master project. There are a few limitations, the most important being that global compiler arguments must be set in the main project before calling subproject. Subprojects must not set global arguments because there is no way to do that reliably over multiple subprojects. To check whether you are running as a subproject, use the `is_subproject` function.
-
-As an example, suppose we have a simple project that provides a shared library.
+As an example, suppose we have a simple project that provides a shared
+library. It would be set up like this.
```meson
project('simple', 'c')
i = include_directories('include')
l = shared_library('simple', 'simple.c', include_directories : i, install : true)
+simple_dep = declare_dependency(include_directories : i,
+ link_with : l)
```
-Then we could use that from a master project. First we generate a subdirectory called `subprojects` in the root of the master directory. Then we create a subdirectory called `simple` and put the subproject in that directory. Now the subproject can be used like this.
+Then we could use that from a master project. First we generate a
+subdirectory called `subprojects` in the root of the master
+directory. Then we create a subdirectory called `simple` and put the
+subproject in that directory. Now the subproject can be used like
+this.
```meson
project('master', 'c')
-dep = dependency('simple', required : false)
-if dep.found()
- i = []
- l = []
-else
- sp = subproject('simple') # This is a name of a subdirectory in subprojects.
- i = sp.get_variable('i')
- l = sp.get_variable('l')
-endif
-exe = executable('prog', 'prog.c', include_directories : i, link_with : l,
+dep = dependency('simple', fallback : ['simple', 'simple_dep']
+exe = executable('prog', 'prog.c',
dependencies : dep, install : true)
```
-With this setup the system dependency is used when it is available, otherwise we fall back on the bundled version.
-
-It should be noted that this only works for subprojects that are built with Meson. It can not be used with any other build system. The reason is the simple fact that there is no possible way to do this reliably with mixed build systems.
-
-Subprojects can use other subprojects, but all subprojects must reside in the top level `subprojects` directory. Recursive use of subprojects is not allowed, though, so you can't have subproject `a` that uses subproject `b` and have `b` also use `a`.
-
-## Subprojects and dependencies
-
-A common use case is to use subprojects to provide dependencies on platforms that do not provide them out of the box. This is especially common on Windows. Meson makes this easy while at the same time using system dependencies if are available. The way to do this is to set up a subproject that builds the dependency and has an internal dependency declared like this:
+With this setup the system dependency is used when it is available,
+otherwise we fall back on the bundled version. If you wish to always
+use the embedded version, then you would declare it like this:
```meson
-proj_dep = declare_dependency(...)
+simple_sp = subproject('simple')
+dep = simple_sp.get_variable('simple_dep')
```
-Then you can use the subproject in the master project like this:
+All Meson features of the subproject, such as project options keep
+working and can be set in the master project. There are a few
+limitations, the most important being that global compiler arguments
+must be set in the main project before calling subproject. Subprojects
+must not set global arguments because there is no way to do that
+reliably over multiple subprojects. To check whether you are running
+as a subproject, use the `is_subproject` function.
-```meson
-sp_dep = dependency('subproj_pkgconfig_name', fallback : ['subproj_name', 'proj_dep'])
-```
+It should be noted that this only works for subprojects that are built
+with Meson. It can not be used with any other build system. The reason
+is the simple fact that there is no possible way to do this reliably
+with mixed build systems.
-This uses the system dependency when available and the self built version if not. If you want to always use the subproject, that is also possible, just use `subproject` and `get_variable` as discussed above to get the dependency object.
+Subprojects can use other subprojects, but all subprojects must reside
+in the top level `subprojects` directory. Recursive use of subprojects
+is not allowed, though, so you can't have subproject `a` that uses
+subproject `b` and have `b` also use `a`.
# Obtaining subprojects
-Meson ships with a dependency system to automatically obtain dependency subprojects. It is documented in the [Wrap dependency system manual](Wrap-dependency-system-manual.md).
+Meson ships with a dependency system to automatically obtain
+dependency subprojects. It is documented in the [Wrap dependency
+system manual](Wrap-dependency-system-manual.md).
diff --git a/docs/markdown/snippets/if-found.md b/docs/markdown/snippets/if-found.md
new file mode 100644
index 0000000..a8d4932
--- /dev/null
+++ b/docs/markdown/snippets/if-found.md
@@ -0,0 +1,13 @@
+# Added `if_found` to subdir
+
+Added a new keyword argument to the `subdir` command. It is given a
+list of dependency objects and the function will only recurse in the
+subdirectory if they are all found. Typical usage goes like this.
+
+ d1 = dependency('foo') # This is found
+ d2 = dependency('bar') # This is not found
+
+ subdir('somedir', if_found : [d1, d2])
+
+In this case the subdirectory would not be entered since `d2` could
+not be found.
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 61f7535..d613f50 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -444,9 +444,9 @@ class Backend:
copt_proxy = OptionOverrideProxy(target.option_overrides, self.environment.coredata.compiler_options)
# First, the trivial ones that are impossible to override.
#
- # Add -nostdinc/-nostdinc++ if needed; can't be overriden
+ # Add -nostdinc/-nostdinc++ if needed; can't be overridden
commands += self.get_cross_stdlib_args(target, compiler)
- # Add things like /NOLOGO or -pipe; usually can't be overriden
+ # Add things like /NOLOGO or -pipe; usually can't be overridden
commands += compiler.get_always_args()
# Only add warning-flags by default if the buildtype enables it, and if
# we weren't explicitly asked to not emit warnings (for Vala, f.ex)
@@ -568,7 +568,7 @@ class Backend:
if isinstance(exe, build.BuildTarget):
is_cross = is_cross and exe.is_cross
if isinstance(exe, dependencies.ExternalProgram):
- # E.g. an external verificator or simulator program run on a generated executable.
+ # E.g. an external verifier or simulator program run on a generated executable.
# Can always be run.
is_cross = False
if is_cross:
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index cea1b08..bcda603 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -220,7 +220,7 @@ int dummy;
outfile.write('# Suffix\n\n')
self.generate_utils(outfile)
self.generate_ending(outfile)
- # Only ovewrite the old build file after the new one has been
+ # Only overwrite the old build file after the new one has been
# fully created.
os.replace(tempfilename, outfilename)
self.generate_compdb()
@@ -2236,7 +2236,7 @@ rule FORTRAN_DEP_HACK
# Fortran is a bit weird (again). When you link against a library, just compiling a source file
# requires the mod files that are output when single files are built. To do this right we would need to
# scan all inputs and write out explicit deps for each file. That is stoo slow and too much effort so
- # instead just have an ordered dependendy on the library. This ensures all required mod files are created.
+ # instead just have an ordered dependency on the library. This ensures all required mod files are created.
# The real deps are then detected via dep file generation from the compiler. This breaks on compilers that
# produce incorrect dep files but such is life.
def get_fortran_orderdeps(self, target, compiler):
@@ -2387,9 +2387,9 @@ rule FORTRAN_DEP_HACK
commands += compilers.get_base_link_args(self.environment.coredata.base_options,
linker,
isinstance(target, build.SharedModule))
- # Add -nostdlib if needed; can't be overriden
+ # Add -nostdlib if needed; can't be overridden
commands += self.get_cross_stdlib_link_args(target, linker)
- # Add things like /NOLOGO; usually can't be overriden
+ # Add things like /NOLOGO; usually can't be overridden
commands += linker.get_linker_always_args()
# Add buildtype linker args: optimization level, etc.
commands += linker.get_buildtype_linker_args(self.get_option_for_target('buildtype', target))
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 5f552c2..8eb95dc 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1137,7 +1137,7 @@ class GeneratedList:
class Executable(BuildTarget):
def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs):
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs)
- # Unless overriden, executables have no suffix or prefix. Except on
+ # Unless overridden, executables have no suffix or prefix. Except on
# Windows and with C#/Mono executables where the suffix is 'exe'
if not hasattr(self, 'prefix'):
self.prefix = ''
@@ -1746,7 +1746,7 @@ class Jar(BuildTarget):
class CustomTargetIndex:
- """A special opaque object returned by indexing a CustomTaget. This object
+ """A special opaque object returned by indexing a CustomTarget. This object
exists in meson, but acts as a proxy in the backends, making targets depend
on the CustomTarget it's derived from, but only adding one source file to
the sources.
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 032ca69..7087b3e 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -451,9 +451,9 @@ class CompilerArgs(list):
Returns whether the argument can be safely de-duped. This is dependent
on three things:
- a) Whether an argument can be 'overriden' by a later argument. For
+ a) Whether an argument can be 'overridden' by a later argument. For
example, -DFOO defines FOO and -UFOO undefines FOO. In this case, we
- can safely remove the previous occurance and add a new one. The same
+ can safely remove the previous occurrence and add a new one. The same
is true for include paths and library paths with -I and -L. For
these we return `2`. See `dedup2_prefixes` and `dedup2_args`.
b) Arguments that once specified cannot be undone, such as `-c` or
@@ -511,10 +511,10 @@ class CompilerArgs(list):
continue
i = self.index(each)
if group_start < 0:
- # First occurance of a library
+ # First occurrence of a library
group_start = i
if group_start >= 0:
- # Last occurance of a library
+ # Last occurrence of a library
self.insert(i + 1, '-Wl,--end-group')
self.insert(group_start, '-Wl,--start-group')
return self.compiler.unix_args_to_native(self)
@@ -548,15 +548,15 @@ class CompilerArgs(list):
raise TypeError('can only concatenate list (not "{}") to list'.format(args))
for arg in args:
# If the argument can be de-duped, do it either by removing the
- # previous occurance of it and adding a new one, or not adding the
- # new occurance.
+ # previous occurrence of it and adding a new one, or not adding the
+ # new occurrence.
dedup = self._can_dedup(arg)
if dedup == 1:
# Argument already exists and adding a new instance is useless
if arg in self or arg in pre or arg in post:
continue
if dedup == 2:
- # Remove all previous occurances of the arg and add it anew
+ # Remove all previous occurrences of the arg and add it anew
if arg in self:
self.remove(arg)
if arg in pre:
@@ -605,7 +605,7 @@ class Compiler:
self.exelist = exelist
else:
raise TypeError('Unknown argument to Compiler')
- # In case it's been overriden by a child class already
+ # In case it's been overridden by a child class already
if not hasattr(self, 'file_suffixes'):
self.file_suffixes = lang_suffixes[self.language]
if not hasattr(self, 'can_compile_suffixes'):
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index fa39793..d15d5da 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -118,7 +118,7 @@ class LLVMDependency(ConfigToolDependency):
"""
# Ordered list of llvm-config binaries to try. Start with base, then try
- # newest back to oldest (3.5 is abitrary), and finally the devel version.
+ # newest back to oldest (3.5 is arbitrary), and finally the devel version.
# Please note that llvm-config-6.0 is a development snapshot and it should
# not be moved to the beginning of the list. The only difference between
# llvm-config-6.0 and llvm-config-devel is that the former is used by
@@ -147,7 +147,7 @@ class LLVMDependency(ConfigToolDependency):
return
self.static = kwargs.get('static', False)
- # Currently meson doesn't really atempt to handle pre-release versions,
+ # Currently meson doesn't really attempt to handle pre-release versions,
# so strip the 'svn' off the end, since it will probably cuase problems
# for users who want the patch version.
self.version = self.version.rstrip('svn')
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index 1b8145e..dd04580 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -202,13 +202,15 @@ class QtBaseDependency(ExternalDependency):
moc = ExternalProgram(os.path.join(self.bindir, 'moc'), silent=True)
uic = ExternalProgram(os.path.join(self.bindir, 'uic'), silent=True)
rcc = ExternalProgram(os.path.join(self.bindir, 'rcc'), silent=True)
+ lrelease = ExternalProgram(os.path.join(self.bindir, 'lrelease'), silent=True)
else:
# We don't accept unsuffixed 'moc', 'uic', and 'rcc' because they
# are sometimes older, or newer versions.
moc = ExternalProgram('moc-' + self.name, silent=True)
uic = ExternalProgram('uic-' + self.name, silent=True)
rcc = ExternalProgram('rcc-' + self.name, silent=True)
- return moc, uic, rcc
+ lrelease = ExternalProgram('lrelease-' + self.name, silent=True)
+ return moc, uic, rcc, lrelease
def _pkgconfig_detect(self, mods, kwargs):
# We set the value of required to False so that we can try the
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 58cc9b9..0cb1450 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -154,7 +154,7 @@ def detect_windows_arch(compilers):
# Check if we're using and inside an MSVC toolchain environment
if compiler.id == 'msvc' and 'VCINSTALLDIR' in os.environ:
# 'Platform' is only set when the target arch is not 'x86'.
- # It's 'x64' when targetting x86_64 and 'arm' when targetting ARM.
+ # It's 'x64' when targeting x86_64 and 'arm' when targeting ARM.
platform = os.environ.get('Platform', 'x86').lower()
if platform == 'x86':
return platform
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index dd0e0e6..b301fee 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1384,6 +1384,7 @@ permitted_kwargs = {'add_global_arguments': {'language'},
'shared_library': shlib_kwargs,
'shared_module': shmod_kwargs,
'static_library': stlib_kwargs,
+ 'subdir': {'if_found'},
'subproject': {'version', 'default_options'},
'test': {'args', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'},
'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'},
@@ -2487,7 +2488,7 @@ to directly access options of other subprojects.''')
self.build.man.append(m)
return m
- @noKwargs
+ @permittedKwargs(permitted_kwargs['subdir'])
def func_subdir(self, node, args, kwargs):
self.validate_arguments(args, 1, [str])
if '..' in args[0]:
@@ -2496,6 +2497,11 @@ to directly access options of other subprojects.''')
raise InvalidArguments('Must not go into subprojects dir with subdir(), use subproject() instead.')
if self.subdir == '' and args[0].startswith('meson-'):
raise InvalidArguments('The "meson-" prefix is reserved and cannot be used for top-level subdir().')
+ for i in mesonlib.extract_as_list(kwargs, 'if_found'):
+ if not hasattr(i, 'found_method'):
+ raise InterpreterException('Object used in if_found does not have a found method.')
+ if not i.found_method([], {}):
+ return
prev_subdir = self.subdir
subdir = os.path.join(prev_subdir, args[0])
if os.path.isabs(subdir):
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index cb82e56..7ccc8b2 100644
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -449,6 +449,11 @@ class InterpreterBase:
return obj % 2 != 0
else:
raise InterpreterException('int.is_odd() must have no arguments.')
+ elif method_name == 'to_string':
+ if not posargs:
+ return str(obj)
+ else:
+ raise InterpreterException('int.to_string() must have no arguments.')
else:
raise InterpreterException('Unknown method "%s" for an integer.' % method_name)
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 09b0f12..771e9ee 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -51,7 +51,7 @@ class Conf:
with open(self.coredata_file, 'wb') as f:
pickle.dump(self.coredata, f)
# We don't write the build file because any changes to it
- # are erased when Meson is executed the next time, i.e. whne
+ # are erased when Meson is executed the next time, i.e. when
# Ninja is run.
def print_aligned(self, arr):
@@ -184,7 +184,7 @@ class Conf:
coarr = []
for k in okeys:
o = self.coredata.base_options[k]
- coarr.append({'name': k, 'descr': o.description, 'value': o.value, 'choices': ''})
+ coarr.append({'name': k, 'descr': o.description, 'value': o.value, 'choices': o.choices})
self.print_aligned(coarr)
print('')
print('Compiler arguments:')
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 56d347e..a35345b 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -32,6 +32,13 @@ def detect_meson_py_location():
# $ meson <args> (gets run from /usr/bin/meson)
in_path_exe = shutil.which(c_fname)
if in_path_exe:
+ # Special case: when run like "./meson.py <opts>" and user has
+ # period in PATH, we need to expand it out, because, for example,
+ # "ninja test" will be run from a different directory.
+ if '.' in os.environ['PATH'].split(':'):
+ p, f = os.path.split(in_path_exe)
+ if p == '' or p == '.':
+ return os.path.join(os.getcwd(), f)
return in_path_exe
# $ python3 ./meson.py <args>
if os.path.exists(c):
@@ -52,7 +59,6 @@ else:
python_command = [sys.executable]
meson_command = python_command + [detect_meson_py_location()]
-
# Put this in objects that should not get dumped to pickle files
# by accident.
import threading
@@ -428,19 +434,28 @@ def do_replacement(regex, line, confdata):
missing_variables = set()
def variable_replace(match):
- varname = match.group(1)
- if varname in confdata:
- (var, desc) = confdata.get(varname)
- if isinstance(var, str):
- pass
- elif isinstance(var, int):
- var = str(var)
- else:
- raise RuntimeError('Tried to replace a variable with something other than a string or int.')
+ # Pairs of escape characters before '@' or '\@'
+ if match.group(0).endswith('\\'):
+ num_escapes = match.end(0) - match.start(0)
+ return '\\' * (num_escapes // 2)
+ # Single escape character and '@'
+ elif match.group(0) == '\\@':
+ return '@'
+ # Template variable to be replaced
else:
- missing_variables.add(varname)
- var = ''
- return var
+ varname = match.group(1)
+ if varname in confdata:
+ (var, desc) = confdata.get(varname)
+ if isinstance(var, str):
+ pass
+ elif isinstance(var, int):
+ var = str(var)
+ else:
+ raise RuntimeError('Tried to replace a variable with something other than a string or int.')
+ else:
+ missing_variables.add(varname)
+ var = ''
+ return var
return re.sub(regex, variable_replace, line), missing_variables
def do_mesondefine(line, confdata):
@@ -473,7 +488,7 @@ def do_conf_file(src, dst, confdata):
raise MesonException('Could not read input file %s: %s' % (src, str(e)))
# Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define
# Also allow escaping '@' with '\@'
- regex = re.compile(r'(?<!\\)@([-a-zA-Z0-9_]+)@')
+ regex = re.compile(r'(?:\\\\)+(?=\\?@)|\\@|@([-a-zA-Z0-9_]+)@')
result = []
missing_variables = set()
for line in data:
@@ -519,7 +534,7 @@ def replace_if_different(dst, dst_tmp):
# unnecessary rebuilds.
different = True
try:
- with open(dst, 'r') as f1, open(dst_tmp, 'r') as f2:
+ with open(dst, 'rb') as f1, open(dst_tmp, 'rb') as f2:
if f1.read() == f2.read():
different = False
except FileNotFoundError:
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index fa8c9e3..f261935 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -300,7 +300,11 @@ def run(original_args, mainfile=None):
elif cmd_name == 'rewrite':
return rewriter.run(remaining_args)
elif cmd_name == 'configure':
- return mconf.run(remaining_args)
+ try:
+ return mconf.run(remaining_args)
+ except MesonException as e:
+ mlog.log(mlog.red('\nError configuring project:'), e)
+ sys.exit(1)
elif cmd_name == 'wrap':
return wraptool.run(remaining_args)
elif cmd_name == 'runpython':
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 285169b..463bf01 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -43,13 +43,13 @@ class QtBaseModule:
kwargs = {'required': 'true', 'modules': 'Core', 'silent': 'true', 'method': method}
qt = _QT_DEPS_LUT[self.qt_version](env, kwargs)
# Get all tools and then make sure that they are the right version
- self.moc, self.uic, self.rcc = qt.compilers_detect()
+ self.moc, self.uic, self.rcc, self.lrelease = qt.compilers_detect()
# Moc, uic and rcc write their version strings to stderr.
# Moc and rcc return a non-zero result when doing so.
# What kind of an idiot thought that was a good idea?
- for compiler, compiler_name in ((self.moc, "Moc"), (self.uic, "Uic"), (self.rcc, "Rcc")):
+ for compiler, compiler_name in ((self.moc, "Moc"), (self.uic, "Uic"), (self.rcc, "Rcc"), (self.lrelease, "lrelease")):
if compiler.found():
- stdout, stderr = Popen_safe(compiler.get_command() + ['-v'])[1:3]
+ stdout, stderr = Popen_safe(compiler.get_command() + ['-version'])[1:3]
stdout = stdout.strip()
stderr = stderr.strip()
if 'Qt {}'.format(self.qt_version) in stderr:
@@ -62,7 +62,7 @@ class QtBaseModule:
raise MesonException('{name} preprocessor is not for Qt {version}. Output:\n{stdo}\n{stderr}'.format(
name=compiler_name, version=self.qt_version, stdo=stdout, stderr=stderr))
mlog.log(' {}:'.format(compiler_name.lower()), mlog.green('YES'), '({path}, {version})'.format(
- path=self.moc.get_path(), version=compiler_ver.split()[-1]))
+ path=compiler.get_path(), version=compiler_ver.split()[-1]))
else:
mlog.log(' {}:'.format(compiler_name.lower()), mlog.red('NO'))
self.tools_detected = True
@@ -137,10 +137,28 @@ class QtBaseModule:
moc_output = moc_gen.process_files('Qt{} moc header'.format(self.qt_version), moc_headers, state)
sources.append(moc_output)
if len(moc_sources) > 0:
- arguments = moc_extra_arguments + ['@INPUT@', '-o', '@OUTPUT@']
+ arguments = moc_extra_arguments + inc + ['@INPUT@', '-o', '@OUTPUT@']
moc_kwargs = {'output': '@BASENAME@.moc',
'arguments': arguments}
moc_gen = build.Generator([self.moc], moc_kwargs)
moc_output = moc_gen.process_files('Qt{} moc source'.format(self.qt_version), moc_sources, state)
sources.append(moc_output)
return ModuleReturnValue(sources, sources)
+
+ @permittedKwargs({'ts_files', 'install', 'install_dir', 'build_by_default', 'method'})
+ def compile_translations(self, state, args, kwargs):
+ ts_files, install_dir = extract_as_list(kwargs, 'ts_files', 'install_dir', pop=True)
+ self._detect_tools(state.environment, kwargs.get('method', 'auto'))
+ translations = []
+ for ts in ts_files:
+ cmd = [self.lrelease, '@INPUT@', '-qm', '@OUTPUT@']
+ lrelease_kwargs = {'output': '@BASENAME@.qm',
+ 'input': ts,
+ 'install': kwargs.get('install', False),
+ 'build_by_default': kwargs.get('build_by_default', False),
+ 'command': cmd}
+ if install_dir is not None:
+ lrelease_kwargs['install_dir'] = install_dir
+ lrelease_target = build.CustomTarget('qt{}-compile-{}'.format(self.qt_version, ts), state.subdir, state.subproject, lrelease_kwargs)
+ translations.append(lrelease_target)
+ return ModuleReturnValue(translations, translations)
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 8400a1a..0465d24 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -111,6 +111,7 @@ class Lexer:
par_count = 0
bracket_count = 0
col = 0
+ newline_rx = re.compile(r'(?<!\\)((?:\\\\)*)\\n')
while loc < len(self.code):
matched = False
value = None
@@ -139,10 +140,9 @@ class Lexer:
elif tid == 'dblquote':
raise ParseException('Double quotes are not supported. Use single quotes.', self.getline(line_start), lineno, col)
elif tid == 'string':
- value = match_text[1:-1]\
- .replace(r"\'", "'")\
- .replace(r" \\ ".strip(), r" \ ".strip())\
- .replace("\\n", "\n")
+ value = match_text[1:-1].replace(r"\'", "'")
+ value = newline_rx.sub(r'\1\n', value)
+ value = value.replace(r" \\ ".strip(), r" \ ".strip())
elif tid == 'multiline_string':
tid = 'string'
value = match_text[3:-3]
diff --git a/run_unittests.py b/run_unittests.py
index 9581c72..8af872e 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1958,7 +1958,7 @@ class LinuxlikeTests(BasePlatformTests):
# Verify that -I flags from the `args` kwarg are first
# This is set in the '43 has function' test case
self.assertEqual(cmd[1], '-I/tmp')
- # Verify that -O3 set via the environment is overriden by -O0
+ # Verify that -O3 set via the environment is overridden by -O0
Oargs = [arg for arg in cmd if arg.startswith('-O')]
self.assertEqual(Oargs, [Oflag, '-O0'])
diff --git a/test cases/common/125 shared module/meson.build b/test cases/common/125 shared module/meson.build
index d96d8fc..29277e9 100644
--- a/test cases/common/125 shared module/meson.build
+++ b/test cases/common/125 shared module/meson.build
@@ -6,7 +6,7 @@ l = shared_library('runtime', 'runtime.c')
# is a common approach for plugins that are only used
# with dlopen. Any symbols are resolved dynamically
# at runtime. This requires extra help on Windows, so
-# should be avoided unless really neccessary.
+# should be avoided unless really necessary.
m = shared_module('mymodule', 'module.c')
e = executable('prog', 'prog.c', link_with : l, dependencies : dl)
test('import test', e, args : m)
diff --git a/test cases/common/126 llvm ir and assembly/meson.build b/test cases/common/126 llvm ir and assembly/meson.build
index 4ce4636..acff93f 100644
--- a/test cases/common/126 llvm ir and assembly/meson.build
+++ b/test cases/common/126 llvm ir and assembly/meson.build
@@ -6,7 +6,7 @@ supported_cpus = ['arm', 'x86', 'x86_64']
foreach lang : ['c', 'cpp']
cc = meson.get_compiler(lang)
cc_id = cc.get_id()
- ## Build a trivial executale with mixed LLVM IR source
+ ## Build a trivial executable with mixed LLVM IR source
if cc_id == 'clang'
e = executable('square_ir_' + lang, 'square.ll', 'main.' + lang)
test('test IR square' + lang, e)
diff --git a/test cases/common/16 configure file/config6.h.in b/test cases/common/16 configure file/config6.h.in
new file mode 100644
index 0000000..9719f87
--- /dev/null
+++ b/test cases/common/16 configure file/config6.h.in
@@ -0,0 +1,19 @@
+/* No escape */
+#define MESSAGE1 "@var1@"
+
+/* Single escape means no replace */
+#define MESSAGE2 "\@var1@"
+
+/* Replace pairs of escapes before '@' or '\@' with escape characters
+ * (note we have to double number of pairs due to C string escaping)
+ */
+#define MESSAGE3 "\\\\@var1@"
+
+/* Pairs of escapes and then single escape to avoid replace */
+#define MESSAGE4 "\\\\\@var1@"
+
+/* Check escaped variable does not overlap following variable */
+#define MESSAGE5 "\@var1@var2@"
+
+/* Check escape character outside variables */
+#define MESSAGE6 "\\ @ \@ \\\\@ \\\\\@"
diff --git a/test cases/common/16 configure file/meson.build b/test cases/common/16 configure file/meson.build
index 4264d07..eda0a8f 100644
--- a/test cases/common/16 configure file/meson.build
+++ b/test cases/common/16 configure file/meson.build
@@ -120,3 +120,14 @@ configure_file(
configuration : conf5
)
test('test5', executable('prog5', 'prog5.c'))
+
+# Test escaping
+conf6 = configuration_data()
+conf6.set('var1', 'foo')
+conf6.set('var2', 'bar')
+configure_file(
+ input : 'config6.h.in',
+ output : '@BASENAME@',
+ configuration : conf6
+)
+test('test6', executable('prog6', 'prog6.c'))
diff --git a/test cases/common/16 configure file/prog6.c b/test cases/common/16 configure file/prog6.c
new file mode 100644
index 0000000..7412404
--- /dev/null
+++ b/test cases/common/16 configure file/prog6.c
@@ -0,0 +1,11 @@
+#include <string.h>
+#include <config6.h>
+
+int main(int argc, char **argv) {
+ return strcmp(MESSAGE1, "foo")
+ || strcmp(MESSAGE2, "@var1@")
+ || strcmp(MESSAGE3, "\\foo")
+ || strcmp(MESSAGE4, "\\@var1@")
+ || strcmp(MESSAGE5, "@var1bar")
+ || strcmp(MESSAGE6, "\\ @ @ \\@ \\@");
+}
diff --git a/test cases/common/165 subdir if_found/meson.build b/test cases/common/165 subdir if_found/meson.build
new file mode 100644
index 0000000..2c640cf
--- /dev/null
+++ b/test cases/common/165 subdir if_found/meson.build
@@ -0,0 +1,11 @@
+project('subdir if found', 'c')
+
+found_dep = declare_dependency()
+not_found_dep = dependency('nonexisting', required : false)
+
+subdir('nonexisting_dir', if_found : not_found_dep)
+
+variable = 3
+
+subdir('subdir', if_found : found_dep)
+assert(variable == 5, 'Subdir was not properly entered.')
diff --git a/test cases/common/165 subdir if_found/subdir/meson.build b/test cases/common/165 subdir if_found/subdir/meson.build
new file mode 100644
index 0000000..1030e25
--- /dev/null
+++ b/test cases/common/165 subdir if_found/subdir/meson.build
@@ -0,0 +1 @@
+variable = 5
diff --git a/test cases/common/42 string operations/meson.build b/test cases/common/42 string operations/meson.build
index d9f8130..e60006a 100644
--- a/test cases/common/42 string operations/meson.build
+++ b/test cases/common/42 string operations/meson.build
@@ -74,3 +74,24 @@ multiline string '''.strip() == '''multiline string''', 'Newlines badly stripped
assert('"1.1.20"'.strip('"') == '1.1.20', '" badly stripped')
assert('"1.1.20"'.strip('".') == '1.1.20', '". badly stripped')
assert('"1.1.20" '.strip('" ') == '1.1.20', '". badly stripped')
+
+bs_b = '''\b'''
+bs_bs_b = '''\\b'''
+nl = '''
+'''
+bs_n = '''\n'''
+bs_nl = '''\
+'''
+bs_bs_n = '''\\n'''
+bs_bs_nl = '''\\
+'''
+
+assert('\b' == bs_b, 'Single backslash broken')
+assert('\\b' == bs_b, 'Double backslash broken')
+assert('\\\b' == bs_bs_b, 'Three backslash broken')
+assert('\\\\b' == bs_bs_b, 'Four backslash broken')
+assert('\n' == nl, 'Newline escape broken')
+assert('\\n' == bs_n, 'Double backslash broken before n')
+assert('\\\n' == bs_nl, 'Three backslash broken before n')
+assert('\\\\n' == bs_bs_n, 'Four backslash broken before n')
+assert('\\\\\n' == bs_bs_nl, 'Five backslash broken before n')
diff --git a/test cases/common/66 install subdir/subdir/meson.build b/test cases/common/66 install subdir/subdir/meson.build
index 37d2da4..a1dadd4 100644
--- a/test cases/common/66 install subdir/subdir/meson.build
+++ b/test cases/common/66 install subdir/subdir/meson.build
@@ -1,3 +1,3 @@
install_subdir('sub1', install_dir : 'share',
- # This mode will be overriden by the mode set in the outer install_subdir
+ # This mode will be overridden by the mode set in the outer install_subdir
install_mode : 'rwxr-x---')
diff --git a/test cases/common/68 number arithmetic/meson.build b/test cases/common/68 number arithmetic/meson.build
index 02c7878..495a83e 100644
--- a/test cases/common/68 number arithmetic/meson.build
+++ b/test cases/common/68 number arithmetic/meson.build
@@ -25,16 +25,16 @@ assert((5 % 2) == 1, 'Integer modulo (odd) is broken')
assert((4 % 2) == 0, 'Integer modulo (even) is broken')
if 2 * 1 % 2 != 0
- error('Modulo precendence with multiplication is broken')
+ error('Modulo precedence with multiplication is broken')
endif
if 2 + 1 % 2 != 3
- error('Modulo precendence with addition is broken')
+ error('Modulo precedence with addition is broken')
endif
if 9 / 9 % 2 != 1
- error('Modulo precendence with division is broken')
+ error('Modulo precedence with division is broken')
endif
if 9 - 9 % 2 != 8
- error('Modulo precendence with subtraction is broken')
+ error('Modulo precedence with subtraction is broken')
endif
assert(2.is_even(), 'int is_even() broken for even value')
diff --git a/test cases/common/71 arithmetic bidmas/meson.build b/test cases/common/71 arithmetic bidmas/meson.build
index 2a530c8..c7334b4 100644
--- a/test cases/common/71 arithmetic bidmas/meson.build
+++ b/test cases/common/71 arithmetic bidmas/meson.build
@@ -1,7 +1,7 @@
project('arithmetic bidmas', 'c')
if 5 * 3 - 6 / 2 + 1 != 13
- error('Arithemtic bidmas broken')
+ error('Arithmetic bidmas broken')
endif
if 5 * (3 - 6 / 2) + 1 != 1
error('Arithmetic bidmas with brackets broken')
diff --git a/test cases/failing/65 grab sibling/subprojects/b/sneaky.c b/test cases/failing/65 grab sibling/subprojects/b/sneaky.c
index f1cb916..46718c6 100644
--- a/test cases/failing/65 grab sibling/subprojects/b/sneaky.c
+++ b/test cases/failing/65 grab sibling/subprojects/b/sneaky.c
@@ -1,6 +1,6 @@
#include<stdio.h>
int main(int argc, char **argv) {
- printf("I can only come into existance via trickery.\n");
+ printf("I can only come into existence via trickery.\n");
return 0;
}
diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build
index 374707a..7c33268 100644
--- a/test cases/frameworks/4 qt/meson.build
+++ b/test cases/frameworks/4 qt/meson.build
@@ -59,6 +59,8 @@ foreach qt : ['qt4', 'qt5']
# We need a console test application because some test environments
# do not have an X server.
+ translations = qtmodule.compile_translations(ts_files : qt+'core_fr.ts', build_by_default : true)
+
qtcore = dependency(qt, modules : 'Core', method : get_option('method'))
qtcoreapp = executable(qt + 'core', 'q5core.cpp',
diff --git a/test cases/frameworks/4 qt/q5core.cpp b/test cases/frameworks/4 qt/q5core.cpp
index 706e4dc..25b80b8 100644
--- a/test cases/frameworks/4 qt/q5core.cpp
+++ b/test cases/frameworks/4 qt/q5core.cpp
@@ -1,8 +1,26 @@
#include <QCoreApplication>
+#include <QtGlobal>
+#include <QString>
+#include <QTranslator>
+#include <QLocale>
+#include <QLibraryInfo>
+#include <QDebug>
int main(int argc, char **argv) {
QCoreApplication app(argc, argv);
+ QTranslator qtTranslator;
+ qtTranslator.load("qt_" + QLocale::system().name(),
+ QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+ app.installTranslator(&qtTranslator);
+
+ QTranslator myappTranslator;
+ if(!myappTranslator.load("qt5core_fr") )
+ return 1;
+
+ app.installTranslator(&myappTranslator);
+
+ qDebug() << QObject::tr("Translate me!");
// Don't actually start the main loop so this
// can be run as a unit test.
//return app.exec();
diff --git a/test cases/frameworks/4 qt/qt4core_fr.ts b/test cases/frameworks/4 qt/qt4core_fr.ts
new file mode 100644
index 0000000..0638bd5
--- /dev/null
+++ b/test cases/frameworks/4 qt/qt4core_fr.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="q5core.cpp" line="23"/>
+ <source>Translate me!</source>
+ <translation>Traduisez moi!</translation>
+ </message>
+</context>
+</TS>
diff --git a/test cases/frameworks/4 qt/qt5core_fr.ts b/test cases/frameworks/4 qt/qt5core_fr.ts
new file mode 100644
index 0000000..4e3116b
--- /dev/null
+++ b/test cases/frameworks/4 qt/qt5core_fr.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fr_FR">
+<context>
+ <name>QObject</name>
+ <message>
+ <location filename="q5core.cpp" line="23"/>
+ <source>Translate me!</source>
+ <translation>Traduisez moi!</translation>
+ </message>
+</context>
+</TS>
diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build
index 7e43821..17feb21 100644
--- a/test cases/linuxlike/1 pkg-config/meson.build
+++ b/test cases/linuxlike/1 pkg-config/meson.build
@@ -23,7 +23,7 @@ dep2 = declare_dependency(dependencies : dep)
exe2 = executable('zlibprog2', 'prog.c', dependencies : dep2)
test('zlibtest2', exe2)
-# Try to find a nonexistant library to ensure requires:false works.
+# Try to find a nonexistent library to ensure requires:false works.
dep = dependency('nvakuhrabnsdfasdf', required : false)
diff --git a/test cases/osx/3 has function xcode8/meson.build b/test cases/osx/3 has function xcode8/meson.build
index 300d352..5fe3e53 100644
--- a/test cases/osx/3 has function xcode8/meson.build
+++ b/test cases/osx/3 has function xcode8/meson.build
@@ -10,16 +10,16 @@ args_10_12 = ['-mmacosx-version-min=10.12'] + sdk_args
# Test requires XCode 8 which has the MacOSX 10.12 SDK
if cc.version().version_compare('>=8.0')
if cc.has_function('clock_gettime', args : args_10_11, prefix : '#include <time.h>')
- error('Should not have found clock_gettime via <time.h> when targetting Mac OS X 10.11')
+ error('Should not have found clock_gettime via <time.h> when targeting Mac OS X 10.11')
endif
if not cc.has_function('clock_gettime', args : args_10_12, prefix : '#include <time.h>')
- error('Did NOT find clock_gettime via <time.h> when targetting Mac OS X 10.12')
+ error('Did NOT find clock_gettime via <time.h> when targeting Mac OS X 10.12')
endif
if not cc.has_function('clock_gettime', args : args_10_11)
- error('Did NOT find clock_gettime w/o a prototype when targetting Mac OS X 10.11')
+ error('Did NOT find clock_gettime w/o a prototype when targeting Mac OS X 10.11')
endif
if not cc.has_function('clock_gettime', args : args_10_12)
- error('Did NOT find clock_gettime w/o a prototype when targetting Mac OS X 10.12')
+ error('Did NOT find clock_gettime w/o a prototype when targeting Mac OS X 10.12')
endif
else
message('Test needs XCode 8, skipping...')