We activate the language in Cmake to test if the compiler is there whenever enable_fortran is given.
But this means that LTO will be tested for fortran as well if we don't say otherwise, even if the compiler was not found (which we allow).
endif()
else()
include(CheckIPOSupported)
endif()
else()
include(CheckIPOSupported)
- check_ipo_supported(RESULT ipo)
+ set(ipoLANGS C CXX)
+ if(SMPI_FORTRAN)
+ set(ipoLANGS ${ipoLANGS} Fortran)
+ endif()
+ check_ipo_supported(RESULT ipo LANGUAGES ${ipoLANGS})
if(ipo)
set(enable_lto ON)
endif()
if(ipo)
set(enable_lto ON)
endif()