aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Dependencies.md29
-rw-r--r--docs/markdown/Reference-manual.md2
-rw-r--r--mesonbuild/compilers/cpp.py4
-rw-r--r--mesonbuild/dependencies/misc.py6
-rw-r--r--mesonbuild/interpreter.py2
-rw-r--r--mesonbuild/mlog.py6
-rw-r--r--mesonbuild/modules/gnome.py3
-rw-r--r--mesonbuild/mtest.py54
-rw-r--r--test cases/frameworks/9 wxwidgets/meson.build2
-rw-r--r--test cases/osx/3 has function xcode8/meson.build8
10 files changed, 81 insertions, 35 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index dbd21aa..bae3edc 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -197,3 +197,32 @@ tools support. You can force one or another via the method keyword:
```meson
wmf_dep = dependency('wmf', method : 'config-tool')
```
+
+## LLVM
+
+Meson has native support for LLVM going back to version LLVM version 3.5.
+It supports a few additional features compared to other config-tool based
+dependencies.
+
+As of 0.44.0 Meson supports the `static` keyword argument for LLVM. Before this
+LLVM >= 3.9 would always dynamically link, while older versions would
+statically link, due to a quirk in `llvm-config`.
+
+### Modules, a.k.a. Components
+
+Meson wraps LLVM's concept of components in it's own modules concept.
+When you need specific components you add them as modules as meson will do the
+right thing:
+
+```meson
+llvm_dep = dependency('llvm', version : '>= 4.0', modules : ['amdgpu'])
+```
+
+As of 0.44.0 it can also take optional modules (these will affect the arguments
+generated for a static link):
+
+```meson
+llvm_dep = dependency(
+ 'llvm', version : '>= 4.0', modules : ['amdgpu'], optional_modules : ['inteljitevents'],
+)
+```
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 424ab58..e6aa9d3 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -855,6 +855,8 @@ This function prints its argument to stdout.
This function prints its argument to stdout prefixed with WARNING:.
+*Added 0.44.0*
+
### project()
``` meson
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index a9093b3..15eb9a0 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -76,7 +76,7 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
def get_options(self):
return {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
- ['none', 'c++03', 'c++11', 'c++14', 'c++1z',
+ ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++1z',
'gnu++11', 'gnu++14', 'gnu++1z'],
'none')}
@@ -102,7 +102,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
def get_options(self):
opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
- ['none', 'c++03', 'c++11', 'c++14', 'c++1z',
+ ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++1z',
'gnu++03', 'gnu++11', 'gnu++14', 'gnu++1z'],
'none'),
'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index e966597..41666a3 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -625,8 +625,10 @@ class Python3Dependency(ExternalDependency):
elif mesonlib.is_osx() and DependencyMethods.EXTRAFRAMEWORK in self.methods:
# In OSX the Python 3 framework does not have a version
# number in its name.
- fw = ExtraFrameworkDependency('python', False, None, self.env,
- self.language, kwargs)
+ # There is a python in /System/Library/Frameworks, but that's
+ # python 2, Python 3 will always bin in /Library
+ fw = ExtraFrameworkDependency(
+ 'python', False, '/Library/Frameworks', self.env, self.language, kwargs)
if fw.found():
self.compile_args = fw.get_compile_args()
self.link_args = fw.get_link_args()
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index b301fee..3e89305 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1368,7 +1368,7 @@ permitted_kwargs = {'add_global_arguments': {'language'},
'build_target': build_target_kwargs,
'configure_file': {'input', 'output', 'configuration', 'command', 'install_dir', 'capture', 'install'},
'custom_target': {'input', 'output', 'command', 'install', 'install_dir', 'build_always', 'capture', 'depends', 'depend_files', 'depfile', 'build_by_default'},
- 'dependency': {'default_options', 'fallback', 'language', 'method', 'modules', 'native', 'required', 'static', 'version'},
+ 'dependency': {'default_options', 'fallback', 'language', 'method', 'modules', 'optional_modules', 'native', 'required', 'static', 'version'},
'declare_dependency': {'include_directories', 'link_with', 'sources', 'dependencies', 'compile_args', 'link_args', 'version'},
'executable': exe_kwargs,
'find_program': {'required', 'native'},
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index 18c1e6a..a0d07ec 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -18,8 +18,10 @@ import sys, os, platform, io
information about Meson runs. Some output goes to screen,
some to logging dir and some goes to both."""
-colorize_console = platform.system().lower() != 'windows' and os.isatty(sys.stdout.fileno()) and \
- os.environ.get('TERM') != 'dumb'
+if platform.system().lower() == 'windows':
+ colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('ANSICON')
+else:
+ colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb'
log_dir = None
log_file = None
log_fname = 'meson-log.txt'
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 7e61242..a53eca8 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -723,7 +723,8 @@ This will become a hard error in the future.''')
@permittedKwargs({'main_xml', 'main_sgml', 'src_dir', 'dependencies', 'install',
'install_dir', 'scan_args', 'scanobjs_args', 'gobject_typesfile',
'fixxref_args', 'html_args', 'html_assets', 'content_files',
- 'mkdb_args', 'ignore_headers', 'include_directories'})
+ 'mkdb_args', 'ignore_headers', 'include_directories',
+ 'namespace', 'mode', 'expand_content_files'})
def gtkdoc(self, state, args, kwargs):
if len(args) != 1:
raise MesonException('Gtkdoc must have one positional argument.')
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 30322aa..b39f5af 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -482,35 +482,41 @@ TIMEOUT: %4d
numlen = len('%d' % len(tests))
self.open_log_files()
wrap = self.get_wrapper()
+ startdir = os.getcwd()
+ if self.options.wd:
+ os.chdir(self.options.wd)
- for _ in range(self.options.repeat):
- for i, test in enumerate(tests):
- visible_name = self.get_pretty_suite(test)
-
- if self.options.gdb:
- test.timeout = None
-
- if not test.is_parallel or self.options.gdb:
- self.drain_futures(futures)
- futures = []
- res = self.run_single_test(wrap, test)
- self.print_stats(numlen, tests, visible_name, res, i)
- else:
- if not executor:
- executor = conc.ThreadPoolExecutor(max_workers=self.options.num_processes)
- f = executor.submit(self.run_single_test, wrap, test)
- futures.append((f, numlen, tests, visible_name, i))
+ try:
+ for _ in range(self.options.repeat):
+ for i, test in enumerate(tests):
+ visible_name = self.get_pretty_suite(test)
+
+ if self.options.gdb:
+ test.timeout = None
+
+ if not test.is_parallel or self.options.gdb:
+ self.drain_futures(futures)
+ futures = []
+ res = self.run_single_test(wrap, test)
+ self.print_stats(numlen, tests, visible_name, res, i)
+ else:
+ if not executor:
+ executor = conc.ThreadPoolExecutor(max_workers=self.options.num_processes)
+ f = executor.submit(self.run_single_test, wrap, test)
+ futures.append((f, numlen, tests, visible_name, i))
+ if self.options.repeat > 1 and self.fail_count:
+ break
if self.options.repeat > 1 and self.fail_count:
break
- if self.options.repeat > 1 and self.fail_count:
- break
- self.drain_futures(futures)
- self.print_summary()
- self.print_collected_logs()
+ self.drain_futures(futures)
+ self.print_summary()
+ self.print_collected_logs()
- if self.logfilename:
- print('Full log written to %s' % self.logfilename)
+ if self.logfilename:
+ print('Full log written to %s' % self.logfilename)
+ finally:
+ os.chdir(startdir)
def drain_futures(self, futures):
for i in futures:
diff --git a/test cases/frameworks/9 wxwidgets/meson.build b/test cases/frameworks/9 wxwidgets/meson.build
index da3aa26..5f9419c 100644
--- a/test cases/frameworks/9 wxwidgets/meson.build
+++ b/test cases/frameworks/9 wxwidgets/meson.build
@@ -1,4 +1,4 @@
-project('wxwidgets test', 'cpp')
+project('wxwidgets test', 'cpp', default_options : ['cpp_std=c++11'])
wxd = dependency('wxwidgets', version : '>=5', required : false)
wxd = dependency('wxwidgets', version : '>=3.0.0', 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 5fe3e53..0df7365 100644
--- a/test cases/osx/3 has function xcode8/meson.build
+++ b/test cases/osx/3 has function xcode8/meson.build
@@ -7,8 +7,12 @@ sdk_args = ['-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/M
args_10_11 = ['-mmacosx-version-min=10.11'] + sdk_args
args_10_12 = ['-mmacosx-version-min=10.12'] + sdk_args
+# XCode 9 location for the macOS 10.13 SDK
+sdk_args = ['-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk']
+args_10_12 = ['-mmacosx-version-min=10.13'] + sdk_args
+
# Test requires XCode 8 which has the MacOSX 10.12 SDK
-if cc.version().version_compare('>=8.0')
+if cc.version().version_compare('>=8.0') and cc.version().version_compare('<9.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 targeting Mac OS X 10.11')
endif
@@ -22,5 +26,5 @@ if cc.version().version_compare('>=8.0')
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...')
+ error('MESON_SKIP_TEST Test needs XCode 8.')
endif