Check cross-pkg-config's viability with ExternalProgram. Closes #1329.

pull/1347/head
Jussi Pakkanen 8 years ago
parent 4a08841331
commit c63b92f8ef
  1. 11
      mesonbuild/dependencies.py

@ -120,10 +120,15 @@ class PkgConfigDependency(Dependency):
if self.required: if self.required:
raise DependencyException('Pkg-config binary missing from cross file') raise DependencyException('Pkg-config binary missing from cross file')
else: else:
potential_pkgbin = environment.cross_info.config['binaries'].get('pkgconfig', 'non_existing_binary') potential_pkgbin = ExternalProgram(environment.cross_info.config['binaries'].get('pkgconfig', 'non_existing_binary'),
if shutil.which(potential_pkgbin): silent=True)
self.pkgbin = potential_pkgbin 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 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 # Only search for the native pkg-config the first time and
# store the result in the class definition # store the result in the class definition
elif PkgConfigDependency.class_pkgbin is None: elif PkgConfigDependency.class_pkgbin is None:

Loading…
Cancel
Save