From 396f35c41dfe662c6e2957e6b34375775184694d Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 5 Apr 2025 18:36:01 +0200 Subject: [PATCH] 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. --- Meta/CMake/lagom_compile_options.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Meta/CMake/lagom_compile_options.cmake b/Meta/CMake/lagom_compile_options.cmake index 671d39e729c..238f3e97098 100644 --- a/Meta/CMake/lagom_compile_options.cmake +++ b/Meta/CMake/lagom_compile_options.cmake @@ -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)