Put LTO behind an optional flag

This commit is contained in:
Philipp David 2022-03-23 10:05:31 +01:00
parent c7c83a35fa
commit dfa5f614aa
No known key found for this signature in database
GPG Key ID: 967A5D5EB5071577

View File

@ -43,6 +43,9 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")
# Fix build with Qt 5.13
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
option(ENABLE_LTO "Enable Link Time Optimization" off)
if(ENABLE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error)
@ -54,6 +57,7 @@ elseif(ipo_supported)
else()
message(STATUS "IPO / LTO not supported: <${ipo_error}>")
endif()
endif()
##################################### Set Application options #####################################