meson
meson copied to clipboard
dependencies/openmp: more robust check for Fortran
Instead of looking for omp.h (which is C/C++ specific) for omp_lib.h, which is only supported by some compilers, just check to see if we can link an OpenMP program with Fortran.
Specifically, on NixOS omp_lib.h is put in a difficult to find place, and I was unable to craft a reliable check that wasn't just a hack for Nix. On the other hand the link test does work reliably, and should be more reliable in general. I lifted this check from @scivision in this comment: https://github.com/mesonbuild/meson/issues/7017#issuecomment-627765921