summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/fortran.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-10-01 09:28:24 -0700
committerDylan Baker <dylan@pnwbakers.com>2024-10-01 10:39:23 -0700
commitcd75bbee9bd887a162f1da9eea2fe24c0b07c312 (patch)
tree8dfb34ceb8105b13c9ab02fece4791044294475b /mesonbuild/compilers/fortran.py
parentd528b83ff2660518009495e02eea1d2917112082 (diff)
downloadmeson-cd75bbee9bd887a162f1da9eea2fe24c0b07c312.tar.gz
compilers: remove hasattr for `file_suffixes`
This is used in exactly two cases, and it's just not worth it. Those two cases can override the default set of extensions, and in the process allow a nice bit of code cleanup, especially toward type checking.
Diffstat (limited to 'mesonbuild/compilers/fortran.py')
-rw-r--r--mesonbuild/compilers/fortran.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index a99a95ce3..5012fba07 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -262,7 +262,6 @@ class SunFortranCompiler(FortranCompiler):
class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler):
- file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp', )
id = 'intel'
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
@@ -275,6 +274,7 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler):
# FIXME: Add support for OS X and Windows in detect_fortran_compiler so
# we are sent the type of compiler
IntelGnuLikeCompiler.__init__(self)
+ self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp', )
default_warn_args = ['-warn', 'general', '-warn', 'truncated_source']
self.warn_args = {'0': [],
'1': default_warn_args,
@@ -318,7 +318,6 @@ class IntelLLVMFortranCompiler(IntelFortranCompiler):
class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler):
- file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp', )
always_args = ['/nologo']
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
@@ -329,6 +328,7 @@ class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler):
is_cross, info, linker=linker,
full_version=full_version)
IntelVisualStudioLikeCompiler.__init__(self, target)
+ self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp', )
default_warn_args = ['/warn:general', '/warn:truncated_source']
self.warn_args = {'0': [],