mirror of https://github.com/oxen-io/lokinet
add WITH_LTO option to disble lto on compile time
This commit is contained in:
parent
7cb542ea23
commit
a6d17dcd16
|
@ -1,10 +1,16 @@
|
|||
# -flto
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_ENABLED OUTPUT ipo_error)
|
||||
if(IPO_ENABLED)
|
||||
message(STATUS "LTO enabled")
|
||||
option(WITH_LTO "enable lto on compile time" ON)
|
||||
if(WITH_LTO)
|
||||
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()
|
||||
message(WARNING "LTO not supported by compiler: ${ipo_error}")
|
||||
message(STATUS "LTO disabled")
|
||||
set(IPO_ENABLED OFF)
|
||||
endif()
|
||||
|
||||
function(enable_lto)
|
||||
|
|
Loading…
Reference in New Issue