summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/objc.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-08-29 10:22:53 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commitfe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c (patch)
treefe25957a1db43513a0b61183d431b498dea40013 /mesonbuild/compilers/objc.py
parentf0a6ba380989c68ecc5af61087157557b329f808 (diff)
downloadmeson-fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c.tar.gz
compilers: remove Compiler.create_option
This saves a *tiny* bit of typing, but at the cost of requiring either the current solution of throwing up our hands and saying "typing is too hard, better to have bugs!" or an extensive amount of `TypedDict`s, `overloads`, and a very new version of mypy. Let's get our type safety back, even if it means writing a little bit more code.
Diffstat (limited to 'mesonbuild/compilers/objc.py')
-rw-r--r--mesonbuild/compilers/objc.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
index 56bc12d45..262a4c484 100644
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -99,6 +99,16 @@ class ClangObjCCompiler(ClangCStds, ClangCompiler, ObjCCompiler):
'3': default_warn_args + ['-Wextra', '-Wpedantic'],
'everything': ['-Weverything']}
+ def form_compileropt_key(self, basename: str) -> OptionKey:
+ if basename == 'std':
+ return OptionKey('c_std', machine=self.for_machine)
+ return super().form_compileropt_key(basename)
+
+ def make_option_name(self, key: OptionKey) -> str:
+ if key.name == 'std':
+ return 'c_std'
+ return super().make_option_name(key)
+
def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:
args = []
std = options.get_value(self.form_compileropt_key('std'))