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

@ -5,6 +5,10 @@ include_directories(.)
set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
if (ENABLE_LTO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
# Set compilation flags
if (MSVC)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)