summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/fortran.py
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2018-09-15 13:13:50 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-16 00:47:32 +0300
commit69ec001b0672094ab92c07f5e561c9c0525aef7b (patch)
treec4ca07ad57cf0eeacd8936599edbaae202e9d42e /mesonbuild/compilers/fortran.py
parent73b47e00250de335513172f0ed0284cd4ac31599 (diff)
downloadmeson-69ec001b0672094ab92c07f5e561c9c0525aef7b.tar.gz
Use enum instead of `int` for compiler variants
* Enums are strongly typed and make the whole `gcc_type`/`clang_type`/`icc_type` distinction redundant. * Enums also allow extending via member functions, which makes the code more generalisable.
Diffstat (limited to 'mesonbuild/compilers/fortran.py')
-rw-r--r--mesonbuild/compilers/fortran.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 3c7c2f95f..b58c4e0d5 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -14,7 +14,7 @@
from .c import CCompiler
from .compilers import (
- ICC_STANDARD,
+ CompilerType,
apple_buildtype_linker_args,
gnulike_buildtype_args,
gnulike_buildtype_linker_args,
@@ -257,9 +257,9 @@ end program prog
class GnuFortranCompiler(GnuCompiler, FortranCompiler):
- def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
- GnuCompiler.__init__(self, gcc_type, defines)
+ GnuCompiler.__init__(self, compiler_type, defines)
default_warn_args = ['-Wall']
self.warn_args = {'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
@@ -279,9 +279,9 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler):
class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler):
- def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
- GnuFortranCompiler.__init__(self, exelist, version, gcc_type, is_cross, exe_wrapper, defines, **kwargs)
- ElbrusCompiler.__init__(self, gcc_type, defines)
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
+ GnuFortranCompiler.__init__(self, exelist, version, compiler_type, is_cross, exe_wrapper, defines, **kwargs)
+ ElbrusCompiler.__init__(self, compiler_type, defines)
class G95FortranCompiler(FortranCompiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
@@ -330,7 +330,7 @@ class IntelFortranCompiler(IntelCompiler, FortranCompiler):
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
# FIXME: Add support for OS X and Windows in detect_fortran_compiler so
# we are sent the type of compiler
- IntelCompiler.__init__(self, ICC_STANDARD)
+ IntelCompiler.__init__(self, CompilerType.ICC_STANDARD)
self.id = 'intel'
default_warn_args = ['-warn', 'general', '-warn', 'truncated_source']
self.warn_args = {'1': default_warn_args,