aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-18 12:08:40 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2019-11-18 22:22:54 +0200
commit050dcf80af99521ea8fee9dff0f71843a3e636f6 (patch)
tree1ad897fcaacaf4c6fc2fd410cbc1a31465a6963d
parent83b4e981c4dd8b8ea521a6150a34636d10a67211 (diff)
downloadmeson-050dcf80af99521ea8fee9dff0f71843a3e636f6.zip
meson-050dcf80af99521ea8fee9dff0f71843a3e636f6.tar.gz
meson-050dcf80af99521ea8fee9dff0f71843a3e636f6.tar.bz2
fortran: note there is no has_function for Fortran
It would be very challenging if not futile to make has_function work for Fortran. The meson.get_compiler('fortran').links() works very well instead. As a reference, CMake's check_fortran_function_exists is completely broken in general. This change raises a useful MesonException instead of giving bizarre errors.
-rw-r--r--mesonbuild/compilers/fortran.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 0d94297..8b2f73e 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -32,7 +32,7 @@ from .mixins.pgi import PGICompiler
from .. import mlog
from mesonbuild.mesonlib import (
- EnvironmentException, MachineChoice, LibType
+ EnvironmentException, MesonException, MachineChoice, LibType
)
if typing.TYPE_CHECKING:
@@ -51,6 +51,12 @@ class FortranCompiler(CLikeCompiler, Compiler):
def get_display_language(self):
return 'Fortran'
+ def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None):
+ raise MesonException('Fortran does not have "has_function" capability.\n'
+ 'It is better to test if a Fortran capability is working like:\n\n'
+ "meson.get_compiler('fortran').links('block; end block; end program')\n\n"
+ 'that example is to see if the compiler has Fortran 2008 Block element.')
+
def sanity_check(self, work_dir: Path, environment):
"""
Check to be sure a minimal program can compile and execute