diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2024-08-29 15:47:20 -0700 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-05 17:45:38 +0200 |
| commit | ba3460eb11bbceaf4fef7352bf286cf27184c99a (patch) | |
| tree | ef001dc11ac342d82296a7e41560dac04f8b89ce /mesonbuild/compilers/fortran.py | |
| parent | 0e11b90d6f2f9c3e18cb8ff84b1622640666e826 (diff) | |
| download | meson-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/fortran.py')
| -rw-r--r-- | mesonbuild/compilers/fortran.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index b004727b4..72c9a5a97 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -121,7 +121,7 @@ class FortranCompiler(CLikeCompiler, Compiler): self.make_option_name(key), 'Fortran language standard to use', 'none', - ['none']) + choices=['none']) return opts @@ -281,8 +281,7 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler): fortran_stds += ['f2008'] if version_compare(self.version, '>=8.0.0'): fortran_stds += ['f2018'] - key = self.form_compileropt_key('std') - opts[key].choices = ['none'] + fortran_stds + self._update_language_stds(opts, fortran_stds) return opts def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: @@ -338,9 +337,7 @@ class ElbrusFortranCompiler(ElbrusCompiler, FortranCompiler): def get_options(self) -> 'MutableKeyedOptionDictType': opts = super().get_options() - fortran_stds = ['f95', 'f2003', 'f2008', 'gnu', 'legacy', 'f2008ts'] - key = self.form_compileropt_key('std') - opts[key].choices = ['none'] + fortran_stds + self._update_language_stds(opts, ['f95', 'f2003', 'f2008', 'gnu', 'legacy', 'f2008ts']) return opts def get_module_outdir_args(self, path: str) -> T.List[str]: @@ -418,8 +415,7 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler): def get_options(self) -> 'MutableKeyedOptionDictType': opts = super().get_options() - key = self.form_compileropt_key('std') - opts[key].choices = ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018'] + self._update_language_stds(opts, ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018']) return opts def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: @@ -473,8 +469,7 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler): def get_options(self) -> 'MutableKeyedOptionDictType': opts = super().get_options() - key = self.form_compileropt_key('std') - opts[key].choices = ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018'] + self._update_language_stds(opts, ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018']) return opts def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: |
