mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-21 21:17:25 +00:00
LTO only on release
This commit is contained in:
parent
7e72febc80
commit
24dae98ec8
@ -10,17 +10,15 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hid
|
|||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
# Check if link-time-optimization is supported and apply it if possible in release builds
|
# Check if link-time-optimization is supported and apply it if possible in release builds
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
include(CheckIPOSupported)
|
||||||
include(CheckIPOSupported)
|
check_ipo_supported(RESULT supported OUTPUT error)
|
||||||
check_ipo_supported(RESULT supported OUTPUT error)
|
|
||||||
|
|
||||||
if(supported)
|
if(supported)
|
||||||
message(STATUS "IPO / LTO enabled")
|
message(STATUS "IPO / LTO enabled")
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
|
||||||
else()
|
else()
|
||||||
message(STATUS "IPO / LTO not supported: <${error}>")
|
message(STATUS "IPO / LTO not supported: <${error}>")
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Read variables from file
|
# Read variables from file
|
||||||
|
Loading…
Reference in New Issue
Block a user