enable lto only for release builds
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
include(CheckIPOSupported)
|
||||
|
||||
function(SetOptimisationSettings)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
check_ipo_supported(RESULT result)
|
||||
if(result)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE PARENT_SCOPE)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
check_ipo_supported(RESULT result)
|
||||
if(result)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user