Meta: Don't require LTO to build in release mode

check_ipo_supported() will by default fail the generation if IPO is not
available; this commit makes it so we continue the build just without
LTO.
This commit is contained in:
Ali Mohammad Pur 2025-04-05 18:36:01 +02:00 committed by Jelle Raaijmakers
parent fe1962d7fa
commit 396f35c41d
Notes: github-actions[bot] 2025-04-05 17:10:55 +00:00

View file

@ -39,8 +39,12 @@ else()
add_cxx_compile_options(-O3)
include(CheckIPOSupported)
check_ipo_supported()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
check_ipo_supported(RESULT IPO_AVAILABLE OUTPUT output)
if(IPO_AVAILABLE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "Not enabling IPO as it is not supported: ${output}")
endif()
endif()
function(add_cxx_linker_flag_if_supported flag)