Skip to content

CheckFortranSource*: Avoid passing -DVAR to linker

The test project is compiled with a -DVAR compiler flag where VAR is the result variable. Tell try_compile to add the flag through add_definitions instead of CMAKE_Fortran_FLAGS so that it is not used for linking. Otherwise some Fortran compilers (e.g. XL 15) do not like the flag when used to drive linking.

Topic-rename: CheckFortranSource-def

Edited by Brad King

Merge request reports