summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-07-12 20:57:04 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2024-07-17 18:37:51 +0300
commit61c742fae9ec74e81b3bb3caf815cf49992fb93c (patch)
tree18b604a698220c713cba3b443c279c7a65f4f6dc /mesonbuild/environment.py
parentde8e3d65e06f91f0927e84dbf215a298b73590b8 (diff)
downloadmeson-61c742fae9ec74e81b3bb3caf815cf49992fb93c.tar.gz
Remove language (AKA compiler) type from OptionKey.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index de4dec8fe..d316f4f66 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -743,14 +743,12 @@ class Environment:
# if it changes on future invocations.
if self.first_invocation:
if keyname == 'ldflags':
- key = OptionKey('link_args', machine=for_machine, lang='c') # needs a language to initialize properly
for lang in compilers.compilers.LANGUAGES_USING_LDFLAGS:
- key = key.evolve(lang=lang)
+ key = OptionKey(name=f'{lang}_link_args', machine=for_machine)
env_opts[key].extend(p_list)
elif keyname == 'cppflags':
- key = OptionKey('env_args', machine=for_machine, lang='c')
for lang in compilers.compilers.LANGUAGES_USING_CPPFLAGS:
- key = key.evolve(lang=lang)
+ key = OptionKey(f'{lang}_env_args', machine=for_machine)
env_opts[key].extend(p_list)
else:
key = OptionKey.from_string(keyname).evolve(machine=for_machine)
@@ -770,7 +768,8 @@ class Environment:
# We still use the original key as the base here, as
# we want to inherit the machine and the compiler
# language
- key = key.evolve('env_args')
+ lang = key.name.split('_', 1)[0]
+ key = key.evolve(f'{lang}_env_args')
env_opts[key].extend(p_list)
# Only store options that are not already in self.options,