summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-06-21 03:53:58 -0400
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-06-24 14:06:32 -0400
commit1d6ed8cac832f1440ebcc74c21db018d8eb485a9 (patch)
tree872644cf9048104d4e37219788eb3b8ac4b49668
parentcf7935be614158b14cf903aed292eaad6a866f4b (diff)
downloadmeson-1d6ed8cac832f1440ebcc74c21db018d8eb485a9.tar.gz
windows ifort can't do shared_library sanely
-rw-r--r--mesonbuild/compilers/fortran.py6
-rw-r--r--test cases/fortran/6 dynamic/meson.build6
2 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 244e6f616..502cd1dac 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -139,9 +139,7 @@ class FortranCompiler(CLikeCompiler, Compiler):
return filename
def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED):
- code = '''program main
- call exit(0)
- end program main'''
+ code = '''stop; end program'''
return self.find_library_impl(libname, env, extra_dirs, code, libtype)
def has_multi_arguments(self, args, env):
@@ -160,7 +158,7 @@ class FortranCompiler(CLikeCompiler, Compiler):
'the compiler you are using. has_link_argument or '
'other similar method can be used instead.'
.format(arg))
- code = 'program main\ncall exit(0)\nend program main'
+ code = 'stop; end program'
return self.has_arguments(args, env, code, mode='compile')
diff --git a/test cases/fortran/6 dynamic/meson.build b/test cases/fortran/6 dynamic/meson.build
index e5e259fc8..244a38b56 100644
--- a/test cases/fortran/6 dynamic/meson.build
+++ b/test cases/fortran/6 dynamic/meson.build
@@ -1,5 +1,11 @@
project('dynamic_fortran', 'fortran')
+if meson.get_compiler('fortran').get_id() == 'intel-cl'
+ error('MESON_SKIP_TEST: Windows ifort does not use shared_library in a sane way')
+ # !DEC$ ATTRIBUTES DLLEXPORT must be used!
+ # https://software.intel.com/en-us/node/535306
+endif
+
dynamic = shared_library('dynamic', 'dynamic.f90')
exe = executable('test_exe', 'main.f90', link_with : dynamic)
test('dynamic-fortran', exe)