diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f0e96c08..dc8defe7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,10 @@ if(MSVC) add_compile_definitions($<$:_NO_DEBUG_HEAP=1>) add_compile_options($<$:/Gw>) add_compile_options($<$:/GS->) # NoBufferSecurityCheck + add_compile_options($<$:/Zi>) # Generate PDB debug info + add_link_options($<$:/DEBUG>) # Emit .pdb for the linked binary + add_link_options($<$:/OPT:REF>) # Remove unreferenced functions/data + add_link_options($<$:/OPT:ICF>) # Fold identical COMDATs # Replace /Ob2 with /Ob3 in CMake's default Release flags string(REPLACE "/Ob2" "/Ob3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") string(REPLACE "/Ob2" "/Ob3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")