File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2222
2323# add_compile_options(-Wall -Wextra -Wpedantic)
2424
25- # Enable LTO when possible.
26- include ( CheckIPOSupported )
27- check_ipo_supported ( RESULT result OUTPUT output )
28- if (result )
29- if ( NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION )
30- set (CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE )
31- endif ()
32- else ( )
33- message (INFO "IPO is not supported: ${output} " )
34- endif ()
25+ if ( NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
26+ message ( CHECK_START "Detecting LTO" )
27+ include ( CheckIPOSupported )
28+ check_ipo_supported ( RESULT CMAKE_INTERPROCEDURAL_OPTIMIZATION OUTPUT LTO_ERROR )
29+ if (LTO_ERROR )
30+ message ( CHECK_FAIL "Not supported: ${LTO_ERROR} " )
31+ else ()
32+ message ( CHECK_PASS "Supported" )
33+ endif ( )
34+ endif ()
3535
3636if (APPLE AND NOT DEFINED CMAKE_OSX_ARCHITECTURES)
3737 set (CMAKE_OSX_ARCHITECTURES "arm64;x86_64" )
You can’t perform that action at this time.
0 commit comments