Disable LTO in CI build with old gcc

This commit is contained in:
Rodrigo Arias 2022-12-19 13:06:00 +01:00
parent 593ed84f1b
commit 3c49517b76
2 changed files with 13 additions and 4 deletions

View File

@ -36,10 +36,16 @@ include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_available OUTPUT error LANGUAGES C)
# Enable IPO by default, if available
if(ipo_available)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO is not supported, expect performance penalty")
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
if(ipo_available)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO is not supported, disabling")
endif()
endif()
if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION)
message(WARNING "IPO is not enabled, expect performance penalty")
endif()
# Extra build type for AddressSanitizer (Asan)

View File

@ -92,6 +92,9 @@ let
stdenv = stdenv;
}).overrideAttrs (old: {
pname = old.name + "@" + stdenv.cc.cc.version;
cmakeFlags = old.cmakeFlags ++ [
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF"
];
});
oldCompilers = [