|
|
@ -1,10 +1,16 @@
|
|
|
|
# -flto
|
|
|
|
# -flto
|
|
|
|
include(CheckIPOSupported)
|
|
|
|
include(CheckIPOSupported)
|
|
|
|
check_ipo_supported(RESULT IPO_ENABLED OUTPUT ipo_error)
|
|
|
|
option(WITH_LTO "enable lto on compile time" ON)
|
|
|
|
if(IPO_ENABLED)
|
|
|
|
if(WITH_LTO)
|
|
|
|
message(STATUS "LTO enabled")
|
|
|
|
check_ipo_supported(RESULT IPO_ENABLED OUTPUT ipo_error)
|
|
|
|
|
|
|
|
if(IPO_ENABLED)
|
|
|
|
|
|
|
|
message(STATUS "LTO enabled")
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
message(WARNING "LTO not supported by compiler: ${ipo_error}")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
else()
|
|
|
|
message(WARNING "LTO not supported by compiler: ${ipo_error}")
|
|
|
|
message(STATUS "LTO disabled")
|
|
|
|
|
|
|
|
set(IPO_ENABLED OFF)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
function(enable_lto)
|
|
|
|
function(enable_lto)
|
|
|
|