Add LTO toggle to DoConfig CMakeLists.txt
This commit is contained in:
parent
c45e888b74
commit
413fe560e4
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ if((${CMAKE_VERSION} VERSION_EQUAL 3.11) OR (${CMAKE_VERSION} VERSION_GREATER 3.
|
|||
cmake_policy(SET CMP0072 NEW)
|
||||
endif()
|
||||
|
||||
option(LTO "Enable link-time optimisation" OFF)
|
||||
option(WARNINGS "Enable common compiler warnings (for GCC-compatible compilers and MSVC only)" OFF)
|
||||
option(WARNINGS_ALL "Enable ALL compiler warnings (for Clang and MSVC only)" OFF)
|
||||
option(WARNINGS_FATAL "Stop compilation on any compiler warning (for GCC-compatible compilers and MSVC only)" OFF)
|
||||
|
@ -140,7 +141,7 @@ else()
|
|||
endif()
|
||||
|
||||
# Enable link-time optimisation if available
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
if(LTO)
|
||||
if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT result)
|
||||
|
|
Loading…
Add table
Reference in a new issue