|
|
|
@ -1,31 +1,32 @@ |
|
|
|
|
project('netcdf_test', 'c', 'cpp') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# --- C tests |
|
|
|
|
nc_c = dependency('netcdf', language : 'c', required : false) |
|
|
|
|
project('netcdf_test', 'c') |
|
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c') |
|
|
|
|
c_code = '''#include <netcdf.h> |
|
|
|
|
int main(void) { return 0; }''' |
|
|
|
|
# --- C |
|
|
|
|
nc_c = dependency('netcdf', language : 'c', required : false, disabler: true) |
|
|
|
|
if not cc.links(c_code, dependencies: nc_c, name: 'NetCDF C') |
|
|
|
|
nc_c = disabler() |
|
|
|
|
endif |
|
|
|
|
if not nc_c.found() |
|
|
|
|
error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.') |
|
|
|
|
endif |
|
|
|
|
exec = executable('exec', 'main.c', dependencies : nc_c) |
|
|
|
|
test('NetCDF C', exec, timeout: 15) |
|
|
|
|
|
|
|
|
|
test('NetCDF C', exec) |
|
|
|
|
|
|
|
|
|
# --- C++ tests |
|
|
|
|
nc_cpp = dependency('netcdf', language : 'cpp', required : false) |
|
|
|
|
if nc_cpp.found() |
|
|
|
|
# --- C++ |
|
|
|
|
if add_languages('cpp', required: false) |
|
|
|
|
nc_cpp = dependency('netcdf', language : 'cpp', required : false, disabler: true) |
|
|
|
|
execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp) |
|
|
|
|
test('NetCDF C++', execpp) |
|
|
|
|
test('NetCDF C++', execpp, timeout: 15) |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
# --- Fortran tests |
|
|
|
|
# --- Fortran |
|
|
|
|
if build_machine.system() != 'windows' and build_machine.system() != 'darwin' |
|
|
|
|
add_languages('fortran') |
|
|
|
|
|
|
|
|
|
nc_f = dependency('netcdf', language : 'fortran', required : false) |
|
|
|
|
if nc_f.found() |
|
|
|
|
if add_languages('fortran', required: false) |
|
|
|
|
nc_f = dependency('netcdf', language : 'fortran', required : false, disabler: true) |
|
|
|
|
exef = executable('exef', 'main.f90', dependencies : nc_f) |
|
|
|
|
|
|
|
|
|
test('NetCDF Fortran', exef) |
|
|
|
|
test('NetCDF Fortran', exef, timeout: 15) |
|
|
|
|
endif |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|