diff options
-rw-r--r-- | test cases/frameworks/25 hdf5/meson.build | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/test cases/frameworks/25 hdf5/meson.build b/test cases/frameworks/25 hdf5/meson.build index ced33b1..0df2ffd 100644 --- a/test cases/frameworks/25 hdf5/meson.build +++ b/test cases/frameworks/25 hdf5/meson.build @@ -19,11 +19,26 @@ if add_languages('cpp', required: false) test('HDF5 C++', execpp, timeout: 30) endif -# --- Fortran tests -if add_languages('fortran', required: false) - h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true, method : method) - exef = executable('exef', 'main.f90', dependencies : h5f) - test('HDF5 Fortran', exef, timeout: 30) +test_fortran = add_languages('fortran', required: false) + +if test_fortran + cpp = meson.get_compiler('cpp') + fc = meson.get_compiler('fortran') + + if host_machine.system() == 'darwin' and cpp.get_id() == 'clang' and fc.get_id() == 'gcc' + # Search paths don't work correctly here and -lgfortran doesn't work + test_fortran = false + elif host_machine.system() == 'windows' and cpp.get_id() != 'gcc' and fc.get_id() == 'gcc' + # mixing gfotran with non-gcc doesn't work on windows + test_fortran = false + endif + + # --- Fortran tests + if test_fortran + h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true, method : method) + exef = executable('exef', 'main.f90', dependencies : h5f) + test('HDF5 Fortran', exef, timeout: 30) + endif endif # Check we can apply a version constraint |