From: Augustin Degomme Date: Fri, 28 Feb 2020 14:24:39 +0000 (+0100) Subject: Only test fortran for LTO if compiler is present. X-Git-Tag: v3.26~861 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3f9cccb2d6ad2f63bfde3faa64aa641d0dbd6432 Only test fortran for LTO if compiler is present. 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). --- diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index 1c4b9a6e4a..2fc6cc8edc 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -119,7 +119,11 @@ if(enable_lto) # User wants LTO. Try if we can do that 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()