From f99ed692c4f10595ccb68407ca618e007125b853 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 30 Mar 2021 10:22:33 -0700 Subject: environment: get environment variables for both host and build machines Fixes #8605 --- mesonbuild/environment.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'mesonbuild/environment.py') diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 373c063..32b3d8f 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -798,11 +798,7 @@ class Environment: env_opts: T.DefaultDict[OptionKey, T.List[str]] = collections.defaultdict(list) - if self.is_cross_build(): - for_machine = MachineChoice.BUILD - else: - for_machine = MachineChoice.HOST - for evar, keyname in opts: + for (evar, keyname), for_machine in itertools.product(opts, MachineChoice): p_env = _get_env_var(for_machine, self.is_cross_build(), evar) if p_env is not None: # these may contain duplicates, which must be removed, else @@ -832,7 +828,7 @@ class Environment: key = key.evolve(lang=lang) env_opts[key].extend(p_list) elif keyname == 'cppflags': - key = OptionKey('args', machine=for_machine, lang='c') + key = OptionKey('env_args', machine=for_machine, lang='c') for lang in compilers.compilers.LANGUAGES_USING_CPPFLAGS: key = key.evolve(lang=lang) env_opts[key].extend(p_list) -- cgit v1.1