summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorhdf89shfdfs <juanr0911@gmail.com>2020-11-13 12:07:02 (GMT)
committerhdf89shfdfs <juanr0911@gmail.com>2020-11-13 12:07:02 (GMT)
commit8cf4a393faf5784c2ce6b8307a771924d91825ca (patch)
treecd4301df89d65173b1e7a02e0860d68d68011520 /CMakeLists.txt
parent3094b5c289b418b31e63ad2e7f52a38cf64e3dfc (diff)
downloadNinja-8cf4a393faf5784c2ce6b8307a771924d91825ca.zip
Ninja-8cf4a393faf5784c2ce6b8307a771924d91825ca.tar.gz
Ninja-8cf4a393faf5784c2ce6b8307a771924d91825ca.tar.bz2
Fix mulit-configuration bug. This affected users who use
multi-configuration generators for building ninja.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 8 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e02849d..0b56e31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,20 +1,18 @@
cmake_minimum_required(VERSION 3.15)
include(CheckIncludeFileCXX)
+include(CheckIPOSupported)
project(ninja)
# --- optional link-time optimization
-if(CMAKE_BUILD_TYPE MATCHES "Release")
- include(CheckIPOSupported)
- check_ipo_supported(RESULT lto_supported OUTPUT error)
-
- if(lto_supported)
- message(STATUS "IPO / LTO enabled")
- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
- else()
- message(STATUS "IPO / LTO not supported: <${error}>")
- endif()
+check_ipo_supported(RESULT lto_supported OUTPUT error)
+
+if(lto_supported)
+ message(STATUS "IPO / LTO enabled")
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
+else()
+ message(STATUS "IPO / LTO not supported: <${error}>")
endif()
# --- compiler flags