diff options
-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 | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies.py | 14 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 12 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 22 |
9 files changed, 39 insertions, 21 deletions
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 954e497..d39f161 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -17,7 +17,7 @@ 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: 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 8582740..4466f22 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1789,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: @@ -1805,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 |