summaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-03-23 20:52:49 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2021-03-30 17:35:56 +0300
commit0b54b81222f092bd859b08af993e2700bddd81be (patch)
tree8eb6042107883a5685a9a4db3296a2a01a91151d /mesonbuild/coredata.py
parente80ff985fb1d4a0b840e5bf67a7e5dff08a21cdd (diff)
downloadmeson-envvarfixup.tar.gz
Split environment variable and command line cflagsenvvarfixup
They are supposed to have different behavior. The environment variables apply to both the compiler and linker when the compiler acts as a linker, but the command line ones do not. Fixes #8345
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r--mesonbuild/coredata.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index df454c3aa..27cb81e83 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -243,6 +243,11 @@ class UserArrayOption(UserOption[T.List[str]]):
', '.join(bad), ', '.join(self.choices)))
return newvalue
+ def extend_value(self, value: T.Union[str, T.List[str]]) -> None:
+ """Extend the value with an additional value."""
+ new = self.validate_value(value)
+ self.set_value(self.value + new)
+
class UserFeatureOption(UserComboOption):
static_choices = ['enabled', 'disabled', 'auto']
@@ -776,8 +781,10 @@ class CoreData:
for_machine: MachineChoice, env: 'Environment') -> None:
"""Add global language arguments that are needed before compiler/linker detection."""
from .compilers import compilers
- options = compilers.get_global_options(lang, comp, for_machine, env)
- self.add_compiler_options(options, lang, for_machine, env)
+ # These options are all new at this point, because the compiler is
+ # responsible for adding its own options, thus calling
+ # `self.options.update()`` is perfectly safe.
+ self.options.update(compilers.get_global_options(lang, comp, for_machine, env))
def process_new_compiler(self, lang: str, comp: 'Compiler', env: 'Environment') -> None:
from . import compilers