diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-02-12 15:51:46 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-04-05 15:08:17 -0700 |
commit | 569e646e1e3556fb5fdb7c4fb012a30145c7145d (patch) | |
tree | 1e42b0750bb3e0f0cce0cb1857916c0b2d7d97b6 /mesonbuild/dependencies/base.py | |
parent | 25eb86382b4b081c1d3992b9bfd9ebc4ab9b3d10 (diff) | |
download | meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.zip meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.tar.gz meson-569e646e1e3556fb5fdb7c4fb012a30145c7145d.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 11 |
1 files changed, 8 insertions, 3 deletions
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: |