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`
pull/5276/head
Dylan Baker 6 years ago
parent 67a5af99aa
commit 0b66a106e3
  1. 7
      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:

Loading…
Cancel
Save