summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-08-29 15:47:20 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commitba3460eb11bbceaf4fef7352bf286cf27184c99a (patch)
treeef001dc11ac342d82296a7e41560dac04f8b89ce /mesonbuild/compilers/c.py
parent0e11b90d6f2f9c3e18cb8ff84b1622640666e826 (diff)
downloadmeson-ba3460eb11bbceaf4fef7352bf286cf27184c99a.tar.gz
options: Add an EnumeratedUserOption class
This will allow us to take choices out of the UserOption class, which doesn't actually use this attribute.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index d8ad9f793..4f93ea14e 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -124,7 +124,7 @@ class ClangCCompiler(ClangCStds, ClangCompiler, CCompiler):
opts = super().get_options()
if self.info.is_windows() or self.info.is_cygwin():
key = self.form_compileropt_key('winlibs')
- opts[key] = options.UserArrayOption(
+ opts[key] = options.UserStringArrayOption(
self.make_option_name(key),
'Standard Windows libraries to link against',
gnu_winlibs)
@@ -257,7 +257,7 @@ class GnuCCompiler(GnuCStds, GnuCompiler, CCompiler):
opts = super().get_options()
if self.info.is_windows() or self.info.is_cygwin():
key = self.form_compileropt_key('winlibs')
- opts[key] = options.UserArrayOption(
+ opts[key] = options.UserStringArrayOption(
self.make_option_name(key),
'Standard Windows libraries to link against',
gnu_winlibs)
@@ -406,7 +406,7 @@ class VisualStudioLikeCCompilerMixin(CompilerMixinBase):
def get_options(self) -> MutableKeyedOptionDictType:
opts = super().get_options()
key = self.form_compileropt_key('winlibs')
- opts[key] = options.UserArrayOption(
+ opts[key] = options.UserStringArrayOption(
self.make_option_name(key),
'Standard Windows libraries to link against',
msvc_winlibs)
@@ -733,9 +733,7 @@ class MetrowerksCCompilerARM(MetrowerksCompiler, CCompiler):
def get_options(self) -> 'MutableKeyedOptionDictType':
opts = super().get_options()
- c_stds = ['c99']
- key = self.form_compileropt_key('std')
- opts[key].choices = ['none'] + c_stds
+ self._update_language_stds(opts, ['c99'])
return opts
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
@@ -763,9 +761,7 @@ class MetrowerksCCompilerEmbeddedPowerPC(MetrowerksCompiler, CCompiler):
def get_options(self) -> 'MutableKeyedOptionDictType':
opts = super().get_options()
- c_stds = ['c99']
- key = self.form_compileropt_key('std')
- opts[key].choices = ['none'] + c_stds
+ self._update_language_stds(opts, ['c99'])
return opts
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: