From 413fe560e45e086841280d20f4f0d73487495062 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 23 Jan 2020 01:00:07 +0000 Subject: [PATCH] Add LTO toggle to DoConfig CMakeLists.txt --- DoConfig/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DoConfig/CMakeLists.txt b/DoConfig/CMakeLists.txt index cf3e7b5c..f0ff9253 100644 --- a/DoConfig/CMakeLists.txt +++ b/DoConfig/CMakeLists.txt @@ -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)