diff options
author | Brad King <brad.king@kitware.com> | 2016-11-15 15:22:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-15 15:24:06 (GMT) |
commit | 6d0b5ff60d288c7847001c1cb01bd55c78cfe4e6 (patch) | |
tree | adf77605ac8a4d8b281f95ffce9aa0cd4e9c50e7 | |
parent | 4790842612b445bc49ee7af4d44f71718e292d48 (diff) | |
download | CMake-6d0b5ff60d288c7847001c1cb01bd55c78cfe4e6.zip CMake-6d0b5ff60d288c7847001c1cb01bd55c78cfe4e6.tar.gz CMake-6d0b5ff60d288c7847001c1cb01bd55c78cfe4e6.tar.bz2 |
MSVC: Do not define _DEBUG explicitly when using /MDd
With the latter flag the compiler automatically defines `_DEBUG`:
https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
Closes: #16430
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index d72ec66..f506500 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -285,13 +285,13 @@ macro(__windows_compiler_msvc lang) # note: MSVC 14 2015 Update 1 sets -fno-ms-compatibility by default, but this does not allow one to compile many projects # that include MS's own headers. CMake itself is affected project too. string(APPEND CMAKE_${lang}_FLAGS_INIT " ${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} -fms-extensions -fms-compatibility -D_WINDOWS -Wall${_FLAGS_${lang}}") - string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -D_DEBUG /MDd -gline-tables-only -fno-inline -O0 ${_RTC1}") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " /MDd -gline-tables-only -fno-inline -O0 ${_RTC1}") string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " /MD -O2 -DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " /MD -gline-tables-only -O2 -fno-inline -DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " /MD -DNDEBUG") # TODO: Add '-Os' once VS generator maps it properly for Clang else() string(APPEND CMAKE_${lang}_FLAGS_INIT " ${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") - string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " /D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " /MDd /Zi /Ob0 /Od ${_RTC1}") string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " /MD /O2 /Ob2 /DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " /MD /Zi /O2 /Ob1 /DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " /MD /O1 /Ob1 /DNDEBUG") |