diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-28 15:29:25 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-10-01 15:06:10 -0700 |
commit | 577a2de7e87128b75e8e7e0c5d1a35986d43fd14 (patch) | |
tree | 1358caa60f0371254c5548a952124b474890add3 /mesonbuild/compilers/fortran.py | |
parent | 4cdc32114bfef1c8512687950a7e61287691e21b (diff) | |
download | meson-577a2de7e87128b75e8e7e0c5d1a35986d43fd14.tar.gz |
compilers/fortran: fix has_multi_*_arguments
The implementation of the link variant was what should have been the
compiler variant, and there was no valid compiler variant, which meant
it was getting C code.
Diffstat (limited to 'mesonbuild/compilers/fortran.py')
-rw-r--r-- | mesonbuild/compilers/fortran.py | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 628a14a94..6cbd2ce4e 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -29,7 +29,6 @@ from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler from .mixins.clang import ClangCompiler from .mixins.elbrus import ElbrusCompiler from .mixins.pgi import PGICompiler -from .. import mlog from mesonbuild.mesonlib import ( version_compare, EnvironmentException, MesonException, MachineChoice, LibType @@ -145,25 +144,11 @@ class FortranCompiler(CLikeCompiler, Compiler): code = 'stop; end program' return self._find_library_impl(libname, env, extra_dirs, code, libtype) + def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: + return self._has_multi_arguments(args, env, 'stop; end program') + def has_multi_link_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: - for arg in args[:]: - # some compilers, e.g. GCC, don't warn for unsupported warning-disable - # flags, so when we are testing a flag like "-Wno-forgotten-towel", also - # check the equivalent enable flag too "-Wforgotten-towel" - # GCC does error for "-fno-foobar" - if arg.startswith('-Wno-'): - args.append('-W' + arg[5:]) - if arg.startswith('-Wl,'): - mlog.warning('{} looks like a linker argument, ' - 'but has_argument and other similar methods only ' - 'support checking compiler arguments. Using them ' - 'to check linker arguments are never supported, ' - 'and results are likely to be wrong regardless of ' - 'the compiler you are using. has_link_argument or ' - 'other similar method can be used instead.' - .format(arg)) - code = 'stop; end program' - return self.has_arguments(args, env, code, mode='compile') + return self._has_multi_link_arguments(args, env, 'stop; end program') class GnuFortranCompiler(GnuCompiler, FortranCompiler): |