From 3f9cccb2d6ad2f63bfde3faa64aa641d0dbd6432 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 28 Feb 2020 15:24:39 +0100 Subject: [PATCH] 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). --- tools/cmake/Flags.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- 2.20.1