Clean-up CMake LTO

Honestly, considering the user can enable LTO by setting
CMAKE_INTERPROCEDURAL_OPTIMIZATION, I might remove this option too...
This commit is contained in:
Clownacy 2020-03-14 20:19:48 +00:00
parent 84cc01b8f0
commit 216aec7caf

View file

@ -209,12 +209,12 @@ set_target_properties(CSE2 PROPERTIES
# Enable link-time optimisation if available # Enable link-time optimisation if available
if(LTO) if(LTO)
if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) include(CheckIPOSupported)
include(CheckIPOSupported)
check_ipo_supported(RESULT result) check_ipo_supported(RESULT result)
if(result)
set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) if(result)
endif() set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif() endif()
endif() endif()