summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-08-29 09:47:39 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commit0e11b90d6f2f9c3e18cb8ff84b1622640666e826 (patch)
tree56772aa8d0b622d6456eb5c58441063d6a6f4c36 /mesonbuild/compilers/cpp.py
parentfe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c (diff)
downloadmeson-0e11b90d6f2f9c3e18cb8ff84b1622640666e826.tar.gz
options: use dataclasses for UserOption
This reduces code, makes this clearer, and will be a nice step toward the goal of getting everything typesafe. For `UserIntegerOption` this makes a fairly nice, but substantial change in that the old method used a tuple of `(min, value, max)` to pass to the initializer, while all other types just passed `value`. The new `UserIntegerOption` does the same, with keyword arguments for the min and max values.
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
-rw-r--r--mesonbuild/compilers/cpp.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index b17e18b3e..7fa9aa833 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -242,8 +242,8 @@ class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('rtti')
opts[key] = options.UserBooleanOption(
@@ -398,8 +398,8 @@ class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler):
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('std')
std_opt = opts[key]
@@ -448,8 +448,8 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('rtti')
opts[key] = options.UserBooleanOption(
@@ -577,8 +577,8 @@ class ElbrusCPPCompiler(ElbrusCompiler, CPPCompiler):
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('debugstl')
opts[key] = options.UserBooleanOption(
@@ -660,8 +660,8 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler):
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('rtti')
opts[key] = options.UserBooleanOption(
@@ -753,8 +753,8 @@ class VisualStudioLikeCPPCompilerMixin(CompilerMixinBase):
opts[key] = options.UserComboOption(
self.make_option_name(key),
'C++ exception handling type.',
- ['none', 'default', 'a', 's', 'sc'],
- 'default')
+ 'default',
+ ['none', 'default', 'a', 's', 'sc'])
key = self.form_compileropt_key('rtti')
opts[key] = options.UserBooleanOption(