summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 048649a32..7e2146111 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -152,12 +152,13 @@ class ClangCCompiler(_ClangCStds, ClangCompiler, CCompiler):
def get_options(self) -> 'MutableKeyedOptionDictType':
opts = super().get_options()
if self.info.is_windows() or self.info.is_cygwin():
- opts.update({
- OptionKey('winlibs', machine=self.for_machine, lang=self.language): coredata.UserArrayOption(
- 'Standard Win libraries to link against',
- gnu_winlibs,
- ),
- })
+ self.update_options(
+ opts,
+ self.create_option(coredata.UserArrayOption,
+ OptionKey('winlibs', machine=self.for_machine, lang=self.language),
+ 'Standard Win libraries to link against',
+ gnu_winlibs),
+ )
return opts
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
@@ -290,12 +291,13 @@ class GnuCCompiler(GnuCompiler, CCompiler):
assert isinstance(std_opt, coredata.UserStdOption), 'for mypy'
std_opt.set_versions(stds, gnu=True)
if self.info.is_windows() or self.info.is_cygwin():
- opts.update({
- key.evolve('winlibs'): coredata.UserArrayOption(
- 'Standard Win libraries to link against',
- gnu_winlibs,
- ),
- })
+ self.update_options(
+ opts,
+ self.create_option(coredata.UserArrayOption,
+ key.evolve('winlibs'),
+ 'Standard Win libraries to link against',
+ gnu_winlibs),
+ )
return opts
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
@@ -425,15 +427,16 @@ class VisualStudioLikeCCompilerMixin(CompilerMixinBase):
"""Shared methods that apply to MSVC-like C compilers."""
- def get_options(self) -> 'MutableKeyedOptionDictType':
- opts = super().get_options()
- opts.update({
- OptionKey('winlibs', machine=self.for_machine, lang=self.language): coredata.UserArrayOption(
+ def get_options(self) -> MutableKeyedOptionDictType:
+ return self.update_options(
+ super().get_options(),
+ self.create_option(
+ coredata.UserArrayOption,
+ OptionKey('winlibs', machine=self.for_machine, lang=self.language),
'Windows libs to link against.',
msvc_winlibs,
),
- })
- return opts
+ )
def get_option_link_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
# need a TypeDict to make this work