diff options
-rw-r--r-- | authors.txt | 2 | ||||
-rw-r--r-- | man/meson.1 | 2 | ||||
-rw-r--r-- | man/mesonconf.1 | 2 | ||||
-rw-r--r-- | man/mesonintrospect.1 | 2 | ||||
-rw-r--r-- | man/mesontest.1 | 2 | ||||
-rw-r--r-- | man/wraptool.1 | 2 | ||||
-rw-r--r-- | mesonbuild/coredata.py | 8 | ||||
-rw-r--r-- | mesonbuild/dependencies.py | 14 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 17 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 22 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_install.py | 3 | ||||
-rwxr-xr-x | run_unittests.py | 6 | ||||
-rw-r--r-- | test cases/common/134 generated llvm ir/copyfile.py (renamed from test cases/common/134 generated llvm ir/copy.py) | 0 | ||||
-rw-r--r-- | test cases/common/134 generated llvm ir/meson.build | 2 | ||||
-rw-r--r-- | test cases/common/135 generated assembly/copyfile.py (renamed from test cases/common/135 generated assembly/copy.py) | 0 | ||||
-rw-r--r-- | test cases/common/135 generated assembly/meson.build | 2 | ||||
-rw-r--r-- | test cases/common/95 dep fallback/meson.build | 3 | ||||
-rw-r--r-- | test cases/java/1 basic/installed_files.txt | 1 | ||||
-rw-r--r-- | test cases/java/1 basic/meson.build | 4 |
19 files changed, 65 insertions, 29 deletions
diff --git a/authors.txt b/authors.txt index 18863eb..2f36256 100644 --- a/authors.txt +++ b/authors.txt @@ -61,3 +61,5 @@ Marc-Antoine Perennou Matthieu Gautier Kseniia Vasilchuk Philipp Geier +Mike Sinkovsky +Dima Krasner diff --git a/man/meson.1 b/man/meson.1 index 0b2a3e4..4ead342 100644 --- a/man/meson.1 +++ b/man/meson.1 @@ -1,4 +1,4 @@ -.TH MESON "1" "January 2017" "meson 0.38.0" "User Commands" +.TH MESON "1" "February 2017" "meson 0.38.1" "User Commands" .SH NAME meson - a high productivity build system .SH DESCRIPTION diff --git a/man/mesonconf.1 b/man/mesonconf.1 index 41ac3e9..53f7f75 100644 --- a/man/mesonconf.1 +++ b/man/mesonconf.1 @@ -1,4 +1,4 @@ -.TH MESONCONF "1" "December 2016" "mesonconf 0.37.1" "User Commands" +.TH MESONCONF "1" "February 2017" "mesonconf 0.38.1" "User Commands" .SH NAME mesonconf - a tool to configure Meson builds .SH DESCRIPTION diff --git a/man/mesonintrospect.1 b/man/mesonintrospect.1 index 8f9cfe8..39169c4 100644 --- a/man/mesonintrospect.1 +++ b/man/mesonintrospect.1 @@ -1,4 +1,4 @@ -.TH MESONCONF "1" "January 2017" "mesonintrospect 0.38.0" "User Commands" +.TH MESONCONF "1" "February 2017" "mesonintrospect 0.38.1" "User Commands" .SH NAME mesonintrospect - a tool to extract information about a Meson build .SH DESCRIPTION diff --git a/man/mesontest.1 b/man/mesontest.1 index 47fdd15..e87efec 100644 --- a/man/mesontest.1 +++ b/man/mesontest.1 @@ -1,4 +1,4 @@ -.TH MESON "1" "December 2016" "meson 0.37.1" "User Commands" +.TH MESON "1" "February 2017" "meson 0.38.1" "User Commands" .SH NAME mesontest - test tool for the Meson build system .SH DESCRIPTION diff --git a/man/wraptool.1 b/man/wraptool.1 index 35b5695..b6abaa9 100644 --- a/man/wraptool.1 +++ b/man/wraptool.1 @@ -1,4 +1,4 @@ -.TH WRAPTOOL "1" "January 2017" "meson 0.38.0" "User Commands" +.TH WRAPTOOL "1" "February 2017" "meson 0.38.1" "User Commands" .SH NAME wraptool - source dependency downloader .SH DESCRIPTION diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 7b4059e..d39f161 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -13,10 +13,11 @@ # limitations under the License. import pickle, os, uuid +from pathlib import PurePath from .mesonlib import MesonException, commonpath from .mesonlib import default_libdir, default_libexecdir, default_prefix -version = '0.38.1' +version = '0.39.0.dev1' backendlist = ['ninja', 'vs2010', 'vs2015', 'xcode'] class UserOption: @@ -159,7 +160,10 @@ class CoreData: if option.endswith('dir') and os.path.isabs(value) and \ option not in builtin_dir_noprefix_options: # Value must be a subdir of the prefix - if commonpath([value, prefix]) != prefix: + # commonpath will always return a path in the native format, so we + # must use pathlib.PurePath to do the same conversion before + # comparing. + if commonpath([value, prefix]) != str(PurePath(prefix)): m = 'The value of the {!r} option is {!r} which must be a ' \ 'subdir of the prefix {!r}.\nNote that if you pass a ' \ 'relative path, it is assumed to be a subdir of prefix.' diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 32e13b7..c894b0e 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -108,14 +108,14 @@ class PkgConfigDependency(Dependency): self.cargs = [] self.libs = [] if 'native' in kwargs and environment.is_cross_build(): - want_cross = not kwargs['native'] + self.want_cross = not kwargs['native'] else: - want_cross = environment.is_cross_build() + self.want_cross = environment.is_cross_build() self.name = name # When finding dependencies for cross-compiling, we don't care about # the 'native' pkg-config - if want_cross: + if self.want_cross: if 'pkgconfig' not in environment.cross_info.config['binaries']: if self.required: raise DependencyException('Pkg-config binary missing from cross file') @@ -142,7 +142,7 @@ class PkgConfigDependency(Dependency): if self.required: raise DependencyException('Pkg-config not found.') return - if want_cross: + if self.want_cross: self.type_string = 'Cross' else: self.type_string = 'Native' @@ -551,9 +551,9 @@ class BoostDependency(Dependency): self.environment = environment self.libdir = '' if 'native' in kwargs and environment.is_cross_build(): - want_cross = not kwargs['native'] + self.want_cross = not kwargs['native'] else: - want_cross = environment.is_cross_build() + self.want_cross = environment.is_cross_build() try: self.boost_root = os.environ['BOOST_ROOT'] if not os.path.isabs(self.boost_root): @@ -561,7 +561,7 @@ class BoostDependency(Dependency): except KeyError: self.boost_root = None if self.boost_root is None: - if want_cross: + if self.want_cross: raise DependencyException('BOOST_ROOT is needed while cross-compiling') if mesonlib.is_windows(): self.boost_root = self.detect_win_root() diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index cb5b617..4466f22 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1576,9 +1576,10 @@ class Interpreter(InterpreterBase): @stringArgs def func_project(self, node, args, kwargs): - if self.environment.first_invocation and ('default_options' in kwargs or + default_options = kwargs.get('default_options', []) + if self.environment.first_invocation and (len(default_options) > 0 or len(self.default_project_options) > 0): - self.parse_default_options(kwargs['default_options']) + self.parse_default_options(default_options) if not self.is_subproject(): self.build.project_name = args[0] if os.path.exists(self.option_file): @@ -1788,6 +1789,15 @@ class Interpreter(InterpreterBase): raise InvalidArguments('''Characters <, > and = are forbidden in target names. To specify version requirements use the version keyword argument instead.''') identifier = dependencies.get_dep_identifier(name, kwargs) + # Check if we want this as a cross-dep or a native-dep + # FIXME: Not all dependencies support such a distinction right now, + # and we repeat this check inside dependencies that do. We need to + # consolidate this somehow. + is_cross = self.environment.is_cross_build() + if 'native' in kwargs and is_cross: + want_cross = not kwargs['native'] + else: + want_cross = is_cross # Check if we've already searched for and found this dep cached_dep = None if identifier in self.coredata.deps: @@ -1804,6 +1814,9 @@ requirements use the version keyword argument instead.''') # so we properly go into fallback/error code paths if kwargs.get('required', True) and not getattr(cached_dep, 'required', False): cached_dep = None + # Don't reuse cached dep if one is a cross-dep and the other is a native dep + if not getattr(cached_dep, 'want_cross', is_cross) == want_cross: + cached_dep = None if cached_dep: dep = cached_dep diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 89dfa99..2a54f3a 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -255,8 +255,9 @@ can not be used with the current version of glib-compiled-resources, due to return dep_files, depends, subdirs - def _get_link_args(self, state, lib, depends=None, include_rpath=False): - if gir_has_extra_lib_arg(): + def _get_link_args(self, state, lib, depends=None, include_rpath=False, + use_gir_args=False): + if gir_has_extra_lib_arg() and use_gir_args: link_command = ['--extra-library=%s' % lib.name] else: link_command = ['-l%s' % lib.name] @@ -269,7 +270,8 @@ can not be used with the current version of glib-compiled-resources, due to depends.append(lib) return link_command - def _get_dependencies_flags(self, deps, state, depends=None, include_rpath=False): + def _get_dependencies_flags(self, deps, state, depends=None, include_rpath=False, + use_gir_args=False): cflags = set() ldflags = set() gi_includes = set() @@ -283,11 +285,13 @@ can not be used with the current version of glib-compiled-resources, due to cflags.update(get_include_args(state.environment, dep.include_directories)) for lib in dep.libraries: ldflags.update(self._get_link_args(state, lib.held_object, depends, include_rpath)) - libdepflags = self._get_dependencies_flags(lib.held_object.get_external_deps(), state, depends, include_rpath) + libdepflags = self._get_dependencies_flags(lib.held_object.get_external_deps(), state, depends, include_rpath, + use_gir_args) cflags.update(libdepflags[0]) ldflags.update(libdepflags[1]) gi_includes.update(libdepflags[2]) - extdepflags = self._get_dependencies_flags(dep.ext_deps, state, depends, include_rpath) + extdepflags = self._get_dependencies_flags(dep.ext_deps, state, depends, include_rpath, + use_gir_args) cflags.update(extdepflags[0]) ldflags.update(extdepflags[1]) gi_includes.update(extdepflags[2]) @@ -314,7 +318,7 @@ can not be used with the current version of glib-compiled-resources, due to # Hack to avoid passing some compiler options in if lib.startswith("-W"): continue - if gir_has_extra_lib_arg(): + if gir_has_extra_lib_arg() and use_gir_args: lib = lib.replace('-l', '--extra-library=') ldflags.update([lib]) @@ -378,7 +382,8 @@ can not be used with the current version of glib-compiled-resources, due to if not isinstance(link_with, list): link_with = [link_with] for link in link_with: - scan_command += self._get_link_args(state, link.held_object, depends) + scan_command += self._get_link_args(state, link.held_object, depends, + use_gir_args=True) if 'includes' in kwargs: includes = kwargs.pop('includes') @@ -478,7 +483,8 @@ can not be used with the current version of glib-compiled-resources, due to # ldflags will be misinterpreted by gir scanner (showing # spurious dependencies) but building GStreamer fails if they # are not used here. - cflags, ldflags, gi_includes = self._get_dependencies_flags(deps, state, depends) + cflags, ldflags, gi_includes = self._get_dependencies_flags(deps, state, depends, + use_gir_args=True) scan_command += list(cflags) # need to put our output directory first as we need to use the # generated libraries instead of any possibly installed system/prefix diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index a74573e..2ffc505 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -237,6 +237,9 @@ def install_targets(d): elif os.path.isfile(fname): do_copyfile(fname, outname) if should_strip: + if fname.endswith('.jar'): + print('Not stripping jar target:', os.path.split(fname)[1]) + continue print('Stripping target {!r}'.format(fname)) ps, stdo, stde = Popen_safe(['strip', outname]) if ps.returncode != 0: diff --git a/run_unittests.py b/run_unittests.py index e8659f4..aed1412 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -15,10 +15,11 @@ import stat import shlex -import unittest, os, sys, shutil, time import subprocess import re, json import tempfile +import pathlib +import unittest, os, sys, shutil, time from glob import glob import mesonbuild.compilers import mesonbuild.environment @@ -169,6 +170,9 @@ class InternalTests(unittest.TestCase): self.assertEqual(commonpath(['/usr', '/bin']), sep) self.assertEqual(commonpath(['/usr', 'bin']), '') self.assertEqual(commonpath(['blam', 'bin']), '') + prefix = '/some/path/to/prefix' + libdir = '/some/path/to/prefix/libdir' + self.assertEqual(commonpath([prefix, libdir]), str(pathlib.PurePath(prefix))) class LinuxlikeTests(unittest.TestCase): diff --git a/test cases/common/134 generated llvm ir/copy.py b/test cases/common/134 generated llvm ir/copyfile.py index da503e2..da503e2 100644 --- a/test cases/common/134 generated llvm ir/copy.py +++ b/test cases/common/134 generated llvm ir/copyfile.py diff --git a/test cases/common/134 generated llvm ir/meson.build b/test cases/common/134 generated llvm ir/meson.build index 7982c23..111cdc0 100644 --- a/test cases/common/134 generated llvm ir/meson.build +++ b/test cases/common/134 generated llvm ir/meson.build @@ -4,7 +4,7 @@ if meson.get_compiler('c').get_id() != 'clang' error('MESON_SKIP_TEST: LLVM IR files can only be built with clang') endif -copy = find_program('copy.py') +copy = find_program('copyfile.py') copygen = generator(copy, arguments : ['@INPUT@', '@OUTPUT@'], diff --git a/test cases/common/135 generated assembly/copy.py b/test cases/common/135 generated assembly/copyfile.py index da503e2..da503e2 100644 --- a/test cases/common/135 generated assembly/copy.py +++ b/test cases/common/135 generated assembly/copyfile.py diff --git a/test cases/common/135 generated assembly/meson.build b/test cases/common/135 generated assembly/meson.build index b5e81d5..6a8744b 100644 --- a/test cases/common/135 generated assembly/meson.build +++ b/test cases/common/135 generated assembly/meson.build @@ -17,7 +17,7 @@ if cc.symbols_have_underscore_prefix() add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'c') endif -copy = find_program('copy.py') +copy = find_program('copyfile.py') output = 'square-@0@.S'.format(cpu) input = output + '.in' diff --git a/test cases/common/95 dep fallback/meson.build b/test cases/common/95 dep fallback/meson.build index 212c64f..9358d29 100644 --- a/test cases/common/95 dep fallback/meson.build +++ b/test cases/common/95 dep fallback/meson.build @@ -1,6 +1,7 @@ project('dep fallback', 'c') -bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false) +bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false, + default_options : 'warning_level=1') if not bob.found() error('Bob is actually needed') endif diff --git a/test cases/java/1 basic/installed_files.txt b/test cases/java/1 basic/installed_files.txt new file mode 100644 index 0000000..1c7cede --- /dev/null +++ b/test cases/java/1 basic/installed_files.txt @@ -0,0 +1 @@ +usr/bin/myprog.jar diff --git a/test cases/java/1 basic/meson.build b/test cases/java/1 basic/meson.build index bed5c0f..201a609 100644 --- a/test cases/java/1 basic/meson.build +++ b/test cases/java/1 basic/meson.build @@ -1,5 +1,7 @@ project('simplejava', 'java') javaprog = jar('myprog', 'com/mesonbuild/Simple.java', - main_class : 'com.mesonbuild.Simple') + main_class : 'com.mesonbuild.Simple', + install : true, + install_dir : get_option('bindir')) test('mytest', javaprog) |