Deduplicate PKG_CONFIG_PATH entries when initializing the array option pkg_config_path.

This avoids a warning about duplicate entries in an array option,
and closes #5736.
pull/5980/head
Olexa Bilaniuk 5 years ago committed by Jussi Pakkanen
parent 2057ffccc3
commit e32b0f8fbb
  1. 8
      mesonbuild/coredata.py

@ -718,7 +718,13 @@ class CoreData:
if env.first_invocation:
p_env = os.environ.get('PKG_CONFIG_PATH')
if p_env:
options['pkg_config_path'] = p_env.split(':')
# PKG_CONFIG_PATH may contain duplicates, which must be
# removed, else a duplicates-in-array-option warning arises.
pkg_config_paths = []
for k in p_env.split(':'):
if k not in pkg_config_paths:
pkg_config_paths.append(k)
options['pkg_config_path'] = pkg_config_paths
for k, v in env.cmd_line_options.items():
if subproject:

Loading…
Cancel
Save