build: Enable link time optimization in release builds. (#6887)

This commit is contained in:
Steveice10 2023-08-26 11:15:13 -07:00 committed by GitHub
parent edf157200d
commit f2e0748a22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 12 additions and 8 deletions

View file

@ -40,8 +40,10 @@ endif()
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(IS_DEBUG_BUILD ON)
set(IS_RELEASE_BUILD OFF)
else()
set(IS_DEBUG_BUILD OFF)
set(IS_RELEASE_BUILD ON)
endif()
option(ENABLE_SDL2 "Enable using SDL2" ON)
@ -73,7 +75,7 @@ CMAKE_DEPENDENT_OPTION(CITRA_ENABLE_BUNDLE_TARGET "Enable the distribution bundl
# Compile options
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
option(ENABLE_LTO "Enable link time optimization" OFF)
option(ENABLE_LTO "Enable link time optimization" ${IS_RELEASE_BUILD})
option(CITRA_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(CITRA_WARNINGS_AS_ERRORS "Enable warnings as errors" ON)