From 938690eef76d036a1682150944e65d956ec9db8d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 7 May 2025 08:18:13 +0200 Subject: environment: split list of important environment variables to a constant Signed-off-by: Paolo Bonzini --- mesonbuild/environment.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index f322cda95..5a687b831 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -50,6 +50,13 @@ if T.TYPE_CHECKING: CompilersDict = T.Dict[str, Compiler] +NON_LANG_ENV_OPTIONS = [ + ('PKG_CONFIG_PATH', 'pkg_config_path'), + ('CMAKE_PREFIX_PATH', 'cmake_prefix_path'), + ('LDFLAGS', 'ldflags'), + ('CPPFLAGS', 'cppflags'), +] + build_filename = 'meson.build' @@ -777,12 +784,7 @@ class Environment: def _set_default_options_from_env(self) -> None: opts: T.List[T.Tuple[str, str]] = ( [(v, f'{k}_args') for k, v in compilers.compilers.CFLAGS_MAPPING.items()] + - [ - ('PKG_CONFIG_PATH', 'pkg_config_path'), - ('CMAKE_PREFIX_PATH', 'cmake_prefix_path'), - ('LDFLAGS', 'ldflags'), - ('CPPFLAGS', 'cppflags'), - ] + NON_LANG_ENV_OPTIONS ) env_opts: T.DefaultDict[OptionKey, T.List[str]] = collections.defaultdict(list) -- cgit v1.2.3