Skip to content

Commit

Permalink
build: Enable LTO/LTCG on Windows Release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jul 7, 2020
1 parent 9a631ff commit 0ad6adc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit 0ad6adc

Please sign in to comment.