diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-10-12 21:43:33 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-03-22 17:20:48 -0400 |
commit | 86aaac8e4229608b25508027267f49624a9a8cb5 (patch) | |
tree | 7e73e59d68e41135a615891237a8b382065ec007 /mesonbuild/backend/backends.py | |
parent | 6c5a0f833238bd7d330dfcb8ca704077acb7861a (diff) | |
download | meson-86aaac8e4229608b25508027267f49624a9a8cb5.zip meson-86aaac8e4229608b25508027267f49624a9a8cb5.tar.gz meson-86aaac8e4229608b25508027267f49624a9a8cb5.tar.bz2 |
backends: Stop separating base and compiler options
Since OptionKey is used we can mix all options together in a single
dictionary. That's already what we do in coredata.options.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index fbcb616..2a955db 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -32,7 +32,7 @@ from .. import mesonlib from .. import mlog from ..compilers import LANGUAGES_USING_LDFLAGS, detect from ..mesonlib import ( - File, MachineChoice, MesonException, OptionType, OrderedSet, OptionOverrideProxy, + File, MachineChoice, MesonException, OrderedSet, OptionOverrideProxy, classify_unity_sources, OptionKey, join_args ) @@ -310,15 +310,9 @@ class Backend: def get_target_filename_abs(self, target: T.Union[build.Target, build.CustomTargetIndex]) -> str: return os.path.join(self.environment.get_build_dir(), self.get_target_filename(target)) - def get_base_options_for_target(self, target: build.BuildTarget) -> OptionOverrideProxy: - return OptionOverrideProxy(target.option_overrides_base, - {k: v for k, v in self.environment.coredata.options.items() - if k.type in {OptionType.BASE, OptionType.BUILTIN}}) - - def get_compiler_options_for_target(self, target: build.BuildTarget) -> OptionOverrideProxy: - comp_reg = {k: v for k, v in self.environment.coredata.options.items() if k.is_compiler()} - comp_override = target.option_overrides_compiler - return OptionOverrideProxy(comp_override, comp_reg) + def get_options_for_target(self, target: build.BuildTarget) -> OptionOverrideProxy: + return OptionOverrideProxy(target.option_overrides, + self.environment.coredata.options) def get_option_for_target(self, option_name: 'OptionKey', target: build.BuildTarget) -> T.Union[str, int, bool, 'WrapMode']: if option_name in target.option_overrides_base: @@ -926,7 +920,7 @@ class Backend: # starting from hard-coded defaults followed by build options and so on. commands = compiler.compiler_args() - copt_proxy = self.get_compiler_options_for_target(target) + copt_proxy = self.get_options_for_target(target) # First, the trivial ones that are impossible to override. # # Add -nostdinc/-nostdinc++ if needed; can't be overridden |