Skip to content

Commit

Permalink
MSVC: Disable incremental linking
Browse files Browse the repository at this point in the history
LTCG doesn't work with incremental linking, but unless we explicitly
disable incremental linking, CMake tells the linker to attempt it.
  • Loading branch information
isilkor committed Jan 1, 2019
1 parent 3a8830a commit 15ad4fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -168,6 +168,7 @@ if(MSVC)
# Enable LTCG for release builds
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ob2 /GL")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ob2 /GL")
add_linker_flags(optimized MODULES exe shared FLAGS "/INCREMENTAL:NO")
add_linker_flags(optimized MODULES exe shared static FLAGS "/LTCG:incremental")

# do not link the release CRT in debug builds
Expand Down

0 comments on commit 15ad4fb

Please sign in to comment.