Skip to content

Commit 3af6dbf

Browse files
committed
⚡ Enable COMDAT folding for release builds
1 parent ad754fb commit 3af6dbf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if (MSVC)
1919
# - smaller binaries are good
2020
# - as well as the direct increase, incremental linking breaks the SizeBench tool
2121
add_link_options("$<$<NOT:$<CONFIG:Debug>>:/INCREMENTAL:NO>")
22+
# COMDAT folding; drops off another 1MB
23+
add_link_options("$<$<NOT:$<CONFIG:Debug>>:/OPT:ICF>")
2224
endif ()
2325

2426
if (${CMAKE_PROJECT_VERSION_TWEAK})

0 commit comments

Comments
 (0)