diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-06-08 12:21:42 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-06-12 11:16:24 -0700 |
commit | f5bd3254e926087091ed4c0e5e561d9118aa114b (patch) | |
tree | dde02e0394523a305267cc3b07ea0f5a7a51120b | |
parent | 18d8dbd3bda56a989bb9f6d767c7491fbbd10d45 (diff) | |
download | meson-f5bd3254e926087091ed4c0e5e561d9118aa114b.zip meson-f5bd3254e926087091ed4c0e5e561d9118aa114b.tar.gz meson-f5bd3254e926087091ed4c0e5e561d9118aa114b.tar.bz2 |
dependencies: Don't allow using the default binary for host on cross compiles
Otherwise we can end up finding dependencies from the build machine for
the host machine, which is incorrect. This alters cmake, pkg-config, and
all config-tool based dependencies.
Fixes: #7276
-rw-r--r-- | mesonbuild/cmake/executor.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/base.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index ae48918..d64286a 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -93,7 +93,7 @@ class CMakeExecutor: mlog.debug('CMake binary for %s is not cached' % self.for_machine) for potential_cmakebin in find_external_program( environment, self.for_machine, 'cmake', 'CMake', - environment.default_cmake): + environment.default_cmake, allow_default_for_cross=False): version_if_ok = self.check_cmake(potential_cmakebin) if not version_if_ok: continue diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 7bff082..828f81e 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -444,7 +444,7 @@ class ConfigToolDependency(ExternalDependency): best_match = (None, None) for potential_bin in find_external_program( self.env, self.for_machine, self.tool_name, - self.tool_name, self.tools): + self.tool_name, self.tools, allow_default_for_cross=False): if not potential_bin.found(): continue tool = potential_bin.get_command() @@ -568,9 +568,9 @@ class PkgConfigDependency(ExternalDependency): else: assert PkgConfigDependency.class_pkgbin[self.for_machine] is None mlog.debug('Pkg-config binary for %s is not cached.' % self.for_machine) - for potential_pkgbin in find_external_program(self.env, self.for_machine, 'pkgconfig', 'Pkg-config', environment.default_pkgconfig): - mlog.debug('Trying pkg-config binary {} for machine {} at {}' - .format(potential_pkgbin.name, self.for_machine, potential_pkgbin.command)) + for potential_pkgbin in find_external_program( + self.env, self.for_machine, 'pkgconfig', 'Pkg-config', + environment.default_pkgconfig, allow_default_for_cross=False): version_if_ok = self.check_pkgconfig(potential_pkgbin) if not version_if_ok: continue |