From 569e646e1e3556fb5fdb7c4fb012a30145c7145d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 12 Feb 2019 15:51:46 -0800 Subject: dependencies: Add command line option for pkg_config_path This creates a new command line option to store pkg_config_path into, and store the environment variable into that option. Currently this works like the environment variable, for both cross and native targets. --- mesonbuild/dependencies/base.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mesonbuild/dependencies/base.py') diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index af4b13f..94a6a6b 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -609,11 +609,16 @@ class PkgConfigDependency(ExternalDependency): return rc, out def _call_pkgbin(self, args, env=None): + # Always copy the environment since we're going to modify it + # with pkg-config variables if env is None: - fenv = env - env = os.environ + env = os.environ.copy() else: - fenv = frozenset(env.items()) + env = env.copy() + + extra_paths = self.env.coredata.get_builtin_option('pkg_config_path') + env['PKG_CONFIG_PATH'] = ':'.join([p for p in extra_paths]) + fenv = frozenset(env.items()) targs = tuple(args) cache = PkgConfigDependency.pkgbin_cache if (self.pkgbin, targs, fenv) not in cache: -- cgit v1.1