Skip to content

Commit b3f86e4

Browse files
authored
[CMAKE] Fix PDB size bloat in unoptimized builds (#1183)
1 parent 6f98469 commit b3f86e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/compilers.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if(MSVC)
2020
# Create PDB for Release as long as debug info was generated during compile.
2121
string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /DEBUG /OPT:REF /OPT:ICF")
2222
string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " /DEBUG /OPT:REF /OPT:ICF")
23+
24+
# /INCREMENTAL:NO prevents PDB size bloat in Debug configuration(s).
25+
add_link_options("/INCREMENTAL:NO")
2326
else()
2427
# We go a bit wild here and assume any other compiler we are going to use supports -g for debug info.
2528
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g")

0 commit comments

Comments
 (0)