[cmake-developers] [CMake 0015014]: for better release debbuging support for /d2Zi+ option should be added for vs2012 and up

Mantis Bug Tracker mantis at public.kitware.com
Thu Jul 10 12:13:27 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15014 
====================================================================== 
Reported By:                Gunnar Roth
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15014
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-07-10 12:13 EDT
Last Modified:              2014-07-10 12:13 EDT
====================================================================== 
Summary:                    for better release debbuging support for /d2Zi+
option should be added for vs2012 and up
Description: 
since vs2012 the option /d2Zi+ is supported by compiler which created much
better debug info for release build and the debugger can actually use it. there
is only a slight increase in pdb size. see
http://randomascii.wordpress.com/2013/09/11/debugging-optimized-codenew-in-visual-studio-2012/



Additional Information: 
this simple patch add the switch to all projects if the compiler is > 1600

--- a\share\cmake-3.0\Modules/Platform/Windows-MSVC.cmake
+++ b\share\cmake-3.0\Modules/Platform/Windows-MSVC.cmake
@@ -254,6 +257,11 @@
   set(CMAKE_${lang}_FLAGS_INIT
"${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS
/W3${_FLAGS_${lang}}")
   set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
   set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
   set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
   set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+  if(MSVC_VERSION GREATER 1600)
+    set(CMAKE_${lang}_FLAGS_DEBUG_INIT "${CMAKE_${lang}_FLAGS_DEBUG_INIT}
/d2Zi+")
+    set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT
"${CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT} /d2Zi+")
+  endif()  
+
 endmacro()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-07-10 12:13 Gunnar Roth    New Issue                                    
======================================================================



More information about the cmake-developers mailing list