mirror of
https://github.com/gbdev/rgbds.git
synced 2026-03-25 06:13:03 +00:00
Enable LTO even for multi-config CMake generators
See https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations for the rationale.
This commit is contained in:
@@ -97,21 +97,21 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
|
|||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
|
message(CHECK_START "Checking if LTO is supported")
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT enable_lto)
|
||||||
|
if(enable_lto)
|
||||||
|
message(CHECK_PASS "yes")
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON)
|
||||||
|
else()
|
||||||
|
message(CHECK_FAIL "no")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
||||||
message(CHECK_START "Checking if LTO is supported")
|
|
||||||
include(CheckIPOSupported)
|
|
||||||
check_ipo_supported(RESULT enable_lto)
|
|
||||||
if(enable_lto)
|
|
||||||
message(CHECK_PASS "yes")
|
|
||||||
set_property(TARGET rgbasm rgblink rgbfix rgbgfx PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
|
|
||||||
else()
|
|
||||||
message(CHECK_FAIL "no")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(man1 "man/rgbasm.1"
|
set(man1 "man/rgbasm.1"
|
||||||
"man/rgbfix.1"
|
"man/rgbfix.1"
|
||||||
"man/rgbgfx.1"
|
"man/rgbgfx.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user