diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-05-16 10:42:56 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-05-16 10:46:39 -0700 |
commit | 0b66a106e3a30a3e751a1e71765ad281f23c33a6 (patch) | |
tree | a968e75682ec1af1b4546a052c1747883c61c6c0 /mesonbuild | |
parent | 67a5af99aa9060c9f4b2350a230343b11282cb8f (diff) | |
download | meson-0b66a106e3a30a3e751a1e71765ad281f23c33a6.zip meson-0b66a106e3a30a3e751a1e71765ad281f23c33a6.tar.gz meson-0b66a106e3a30a3e751a1e71765ad281f23c33a6.tar.bz2 |
coredata: fix bugs reading PKG_CONFIG_PATH
There are two distinct bugs here:
1) if PKG_CONFIG_PATH is unset then the variable will be set to [''],
which causes it to have the wrong behavior in some truthiness tests
2) We read PKG_CONFIG_PATH on invocations after the first, which causes
it to overwrite the value saved into the coredata.dat file. Putting
the two bugs together it means that -Dpkg_config_path doesn't work
with `meson configure`
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/coredata.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index b8f0578..6c357ce 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -510,8 +510,11 @@ class CoreData: # Some options default to environment variables if they are # unset, set those now. These will either be overwritten - # below, or they won't. - options['pkg_config_path'] = os.environ.get('PKG_CONFIG_PATH', '').split(':') + # below, or they won't. These should only be set on the first run. + if env.first_invocation: + p_env = os.environ.get('PKG_CONFIG_PATH') + if p_env: + options['pkg_config_path'] = p_env.split(':') for k, v in env.cmd_line_options.items(): if subproject: |