diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-03-30 10:22:33 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-04-01 09:54:43 -0700 |
commit | f99ed692c4f10595ccb68407ca618e007125b853 (patch) | |
tree | 81d5ef2b4f28e1bfb7c5620ae1a500d7a1c96e9e /mesonbuild/environment.py | |
parent | 848cacc38c7f5bef2b363b7a1864457e257ebd3d (diff) | |
download | meson-f99ed692c4f10595ccb68407ca618e007125b853.zip meson-f99ed692c4f10595ccb68407ca618e007125b853.tar.gz meson-f99ed692c4f10595ccb68407ca618e007125b853.tar.bz2 |
environment: get environment variables for both host and build machines
Fixes #8605
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 8 |
1 files changed, 2 insertions, 6 deletions
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) |