build: Enable LTO/LTCG on Windows Release builds
This commit is contained in:
parent
9a631ff52c
commit
0ad6adc900
|
@ -120,6 +120,11 @@ if(MSVC)
|
|||
# COMDAT folding/remove unused functions.
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /OPT:REF /OPT:ICF")
|
||||
|
||||
# Enable LTO/LTCG on Release builds.
|
||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue