diff options
Diffstat (limited to 'mesonbuild/compilers/fortran.py')
-rw-r--r-- | mesonbuild/compilers/fortran.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 72c9a5a..0885518 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -27,12 +27,13 @@ from mesonbuild.mesonlib import ( ) if T.TYPE_CHECKING: - from ..coredata import MutableKeyedOptionDictType, KeyedOptionDictType + from ..coredata import MutableKeyedOptionDictType from ..dependencies import Dependency from ..envconfig import MachineInfo from ..environment import Environment from ..linkers.linkers import DynamicLinker from ..mesonlib import MachineChoice + from ..build import BuildTarget class FortranCompiler(CLikeCompiler, Compiler): @@ -284,10 +285,10 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler): self._update_language_stds(opts, fortran_stds) return opts - def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: + def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - key = self.form_compileropt_key('std') - std = options.get_value(key) + std = self.get_compileropt_value('std', env, target, subproject) + assert isinstance(std, str) if std != 'none': args.append('-std=' + std) return args @@ -418,11 +419,11 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler): self._update_language_stds(opts, ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018']) return opts - def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: + def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - key = self.form_compileropt_key('std') - std = options.get_value(key) + std = self.get_compileropt_value('std', env, target, subproject) stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} + assert isinstance(std, str) if std != 'none': args.append('-stand=' + stds[std]) return args @@ -472,11 +473,11 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler): self._update_language_stds(opts, ['none', 'legacy', 'f95', 'f2003', 'f2008', 'f2018']) return opts - def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: + def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]: args: T.List[str] = [] - key = self.form_compileropt_key('std') - std = options.get_value(key) + std = self.get_compileropt_value('std', env, target, subproject) stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} + assert isinstance(std, str) if std != 'none': args.append('/stand:' + stds[std]) return args |