Fix mulit-configuration bug. This affected users who use

multi-configuration generators for building ninja.
This commit is contained in:
hdf89shfdfs 2020-11-13 07:07:02 -05:00
parent 3094b5c289
commit 8cf4a393fa

View File

@ -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)
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()
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