windows ifort can't do shared_library sanely

pull/5524/head
Michael Hirsch, Ph.D 6 years ago
parent cf7935be61
commit 1d6ed8cac8
  1. 6
      mesonbuild/compilers/fortran.py
  2. 6
      test cases/fortran/6 dynamic/meson.build

@ -139,9 +139,7 @@ class FortranCompiler(CLikeCompiler, Compiler):
return filename return filename
def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED): def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED):
code = '''program main code = '''stop; end program'''
call exit(0)
end program main'''
return self.find_library_impl(libname, env, extra_dirs, code, libtype) return self.find_library_impl(libname, env, extra_dirs, code, libtype)
def has_multi_arguments(self, args, env): def has_multi_arguments(self, args, env):
@ -160,7 +158,7 @@ class FortranCompiler(CLikeCompiler, Compiler):
'the compiler you are using. has_link_argument or ' 'the compiler you are using. has_link_argument or '
'other similar method can be used instead.' 'other similar method can be used instead.'
.format(arg)) .format(arg))
code = 'program main\ncall exit(0)\nend program main' code = 'stop; end program'
return self.has_arguments(args, env, code, mode='compile') return self.has_arguments(args, env, code, mode='compile')

@ -1,5 +1,11 @@
project('dynamic_fortran', 'fortran') 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') dynamic = shared_library('dynamic', 'dynamic.f90')
exe = executable('test_exe', 'main.f90', link_with : dynamic) exe = executable('test_exe', 'main.f90', link_with : dynamic)
test('dynamic-fortran', exe) test('dynamic-fortran', exe)

Loading…
Cancel
Save