diff options
author | John Ericson <git@JohnEricson.me> | 2019-05-12 12:38:11 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-15 14:21:47 +0300 |
commit | 4030e7cb7ad54dd2df0686f41459fc6293c8284f (patch) | |
tree | e7366f78785419ad7d301fb68bc4b508fba9079e /mesonbuild/compilers/c.py | |
parent | 7b8ef78bc0002d0327626c6218b793f87c2a5eb8 (diff) | |
download | meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.zip meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.gz meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.bz2 |
UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its
name, and also contains its own name. In general, the maxim in
programming is things shouldn't know their own name, so removed the name
field just leaving the option's position in the dictionary as its name.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r-- | mesonbuild/compilers/c.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 0cfcbc3..5d78ba6 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -96,7 +96,7 @@ class ClangCCompiler(ClangCompiler, CCompiler): if version_compare(self.version, v): c_stds += ['c17'] g_stds += ['gnu17'] - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none'] + c_stds + g_stds, 'none')}) return opts @@ -130,7 +130,7 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler): def get_options(self): opts = CCompiler.get_options(self) - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none', 'c90', 'c99', 'c11', 'gnu90', 'gnu99', 'gnu11'], 'none')}) @@ -165,12 +165,12 @@ class GnuCCompiler(GnuCompiler, CCompiler): if version_compare(self.version, v): c_stds += ['c17', 'c18'] g_stds += ['gnu17', 'gnu18'] - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none'] + c_stds + g_stds, 'none')}) if self.compiler_type.is_windows_compiler: opts.update({ - 'c_winlibs': coredata.UserArrayOption('c_winlibs', 'Standard Win libraries to link against', + 'c_winlibs': coredata.UserArrayOption('Standard Win libraries to link against', gnu_winlibs), }) return opts @@ -204,7 +204,7 @@ class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler): # It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports. def get_options(self): opts = CCompiler.get_options(self) - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none', 'c89', 'c90', 'c9x', 'c99', 'c1x', 'c11', 'gnu89', 'gnu90', 'gnu9x', 'gnu99', 'gnu1x', 'gnu11', 'iso9899:2011', 'iso9899:1990', 'iso9899:199409', 'iso9899:1999'], @@ -239,7 +239,7 @@ class IntelCCompiler(IntelGnuLikeCompiler, CCompiler): g_stds = ['gnu89', 'gnu99'] if version_compare(self.version, '>=16.0.0'): c_stds += ['c11'] - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none'] + c_stds + g_stds, 'none')}) return opts @@ -258,8 +258,7 @@ class VisualStudioLikeCCompilerMixin: def get_options(self): opts = super().get_options() - opts.update({'c_winlibs': coredata.UserArrayOption('c_winlibs', - 'Windows libs to link against.', + opts.update({'c_winlibs': coredata.UserArrayOption('Windows libs to link against.', msvc_winlibs)}) return opts @@ -317,7 +316,7 @@ class ArmCCompiler(ArmCompiler, CCompiler): def get_options(self): opts = CCompiler.get_options(self) - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none', 'c90', 'c99'], 'none')}) return opts @@ -340,7 +339,7 @@ class CcrxCCompiler(CcrxCompiler, CCompiler): def get_options(self): opts = CCompiler.get_options(self) - opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use', + opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none', 'c89', 'c99'], 'none')}) return opts |