Merge pull request #2509 from madebr/boost_dependency_pkg_config

Enable get_pkgconfig_variable for python3 dependencies (if pkg-config is used)
pull/2625/head
Jussi Pakkanen 7 years ago committed by GitHub
commit c63b3d253d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      mesonbuild/dependencies/misc.py
  2. 5
      test cases/python3/2 extmodule/meson.build

@ -602,15 +602,18 @@ class Python3Dependency(ExternalDependency):
self.name = 'python3'
# We can only be sure that it is Python 3 at this point
self.version = '3'
self.pkgdep = None
if DependencyMethods.PKGCONFIG in self.methods:
try:
pkgdep = PkgConfigDependency('python3', environment, kwargs)
if pkgdep.found():
self.compile_args = pkgdep.get_compile_args()
self.link_args = pkgdep.get_link_args()
self.version = pkgdep.get_version()
self.pkgdep = PkgConfigDependency('python3', environment, kwargs)
if self.pkgdep.found():
self.compile_args = self.pkgdep.get_compile_args()
self.link_args = self.pkgdep.get_link_args()
self.version = self.pkgdep.get_version()
self.is_found = True
return
else:
self.pkgdep = None
except Exception:
pass
if not self.is_found:
@ -674,6 +677,12 @@ class Python3Dependency(ExternalDependency):
else:
return [DependencyMethods.PKGCONFIG]
def get_pkgconfig_variable(self, variable_name):
if self.pkgdep:
return self.pkgdep.get_pkgconfig_variable(variable_name)
else:
return super().get_pkgconfig_variable(variable_name)
class PcapDependency(ExternalDependency):
def __init__(self, environment, kwargs):

@ -17,3 +17,8 @@ if py3_dep.found()
else
error('MESON_SKIP_TEST: Python3 libraries not found, skipping test.')
endif
py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
if py3_pkg_dep.found()
python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir')
endif

Loading…
Cancel
Save