aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-25 23:17:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-28 19:06:09 +0200
commitc63b92f8efaf226c2431a057a822bf00e0bf3189 (patch)
tree8598fd041c3194518cc1de8f92204d32774993fe
parent4a08841331cf0bb281ff5fa37ac106b539423140 (diff)
downloadmeson-c63b92f8efaf226c2431a057a822bf00e0bf3189.zip
meson-c63b92f8efaf226c2431a057a822bf00e0bf3189.tar.gz
meson-c63b92f8efaf226c2431a057a822bf00e0bf3189.tar.bz2
Check cross-pkg-config's viability with ExternalProgram. Closes #1329.
-rw-r--r--mesonbuild/dependencies.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
index 5ccc391..32e13b7 100644
--- a/mesonbuild/dependencies.py
+++ b/mesonbuild/dependencies.py
@@ -120,10 +120,15 @@ class PkgConfigDependency(Dependency):
if self.required:
raise DependencyException('Pkg-config binary missing from cross file')
else:
- potential_pkgbin = environment.cross_info.config['binaries'].get('pkgconfig', 'non_existing_binary')
- if shutil.which(potential_pkgbin):
- self.pkgbin = potential_pkgbin
+ potential_pkgbin = ExternalProgram(environment.cross_info.config['binaries'].get('pkgconfig', 'non_existing_binary'),
+ silent=True)
+ if potential_pkgbin.found():
+ # FIXME, we should store all pkg-configs in ExternalPrograms.
+ # However that is too destabilizing a change to do just before release.
+ self.pkgbin = potential_pkgbin.get_command()[0]
PkgConfigDependency.class_pkgbin = self.pkgbin
+ else:
+ mlog.debug('Cross pkg-config %s not found.' % potential_pkgbin.name)
# Only search for the native pkg-config the first time and
# store the result in the class definition
elif PkgConfigDependency.class_pkgbin is None: