summaryrefslogtreecommitdiffstats
path: root/test cases/fortran/14 fortran links c/meson.build
blob: 380a85ac35bff82d7f885033b76aae7545d9039b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
project('Fortran calling C', 'fortran', 'c',
  meson_version: '>= 0.51.0',
  default_options : ['default_library=static'])

ccid = meson.get_compiler('c').get_id()
fcid = meson.get_compiler('fortran').get_id()

if fcid == 'gcc' and ccid in ['msvc', 'clang-cl']
  error('MESON_SKIP_TEST: MSVC and GCC do not interoperate like this.')
endif

c_lib = library('clib', 'clib.c', vs_module_defs : 'clib.def')

f_call_c = executable('f_call_c', 'f_call_c.f90',
  link_with: c_lib,
  link_language: 'fortran')
test('Fortran calling C', f_call_c)