diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-04-19 14:41:39 +0200 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-05-15 10:10:49 -0700 |
| commit | 8dfecd2ad8d01a8f52db3b5552b1839ce7a1edd7 (patch) | |
| tree | 7059710e0e40cd13f1ad30c08a80cec5a36859cb | |
| parent | 4cdff788e77403daeb1b7a91ee8a62d3783a7e8e (diff) | |
| download | meson-8dfecd2ad8d01a8f52db3b5552b1839ce7a1edd7.tar.gz | |
coredata: assert compiler OptionKeys have the right shape
The subproject and machine should already be correct, thanks
to form_compileropt_key.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | mesonbuild/coredata.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 238b1e8c8..e461e9f96 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -575,14 +575,14 @@ class CoreData: def add_compiler_options(self, c_options: MutableKeyedOptionDictType, lang: str, for_machine: MachineChoice, env: Environment, subproject: str) -> None: for k, o in c_options.items(): - comp_key = OptionKey(f'{k.name}', None, for_machine) + assert k.subproject is None and k.machine is for_machine if lang == 'objc' and k.name == 'c_std': # For objective C, always fall back to c_std. - self.optstore.add_compiler_option('c', comp_key, o) + self.optstore.add_compiler_option('c', k, o) elif lang == 'objcpp' and k.name == 'cpp_std': - self.optstore.add_compiler_option('cpp', comp_key, o) + self.optstore.add_compiler_option('cpp', k, o) else: - self.optstore.add_compiler_option(lang, comp_key, o) + self.optstore.add_compiler_option(lang, k, o) def add_lang_args(self, lang: str, comp: T.Type['Compiler'], for_machine: MachineChoice, env: 'Environment') -> None: |
