Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Only test fortran for LTO if compiler is present.
authorAugustin Degomme <adegomme@gmail.com>
Fri, 28 Feb 2020 14:24:39 +0000 (15:24 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Fri, 28 Feb 2020 14:24:39 +0000 (15:24 +0100)
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

index 1c4b9a6..2fc6cc8 100644 (file)
@@ -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()