diff options
author | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-04-07 07:55:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-07 07:55:36 +0000 |
commit | ef87d11dcdcd2685e6dd5fa994e155a0801a630b (patch) | |
tree | 4bd887dd6c6b837036dda6ab90c5ebf623d3fa41 /mesonbuild/dependencies/base.py | |
parent | a2c3ba474a5ad47539b5ecf7218db272fab8359f (diff) | |
parent | 91b2475e30d7659dad24eb35b47e4d098c716792 (diff) | |
download | meson-ef87d11dcdcd2685e6dd5fa994e155a0801a630b.zip meson-ef87d11dcdcd2685e6dd5fa994e155a0801a630b.tar.gz meson-ef87d11dcdcd2685e6dd5fa994e155a0801a630b.tar.bz2 |
Merge pull request #4931 from dcbaker/pkg-config-builtin
dependencies: Add command line option for pkg_config_path
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index ddc56fc..f74eabb 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -617,11 +617,19 @@ 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() + + if self.want_cross: + extra_paths = self.env.coredata.get_builtin_option('cross_pkg_config_path') + else: + 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: |