CMake: Avoids defining _DEBUG on MSVC Release builds. Fixes PR 4379.
authorOscar Fuentes <ofv@wanadoo.es>
Sun, 5 Jul 2009 18:43:52 +0000 (18:43 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Sun, 5 Jul 2009 18:43:52 +0000 (18:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74794 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 56f9355d8eb4ca65e9ddcc723c3cd204a770c6bd..6abfa4f215e5a766c6d7f7740f543dd1d33d2680 100644 (file)
@@ -65,7 +65,10 @@ else()
 endif()
 
 if( LLVM_ENABLE_ASSERTIONS )
-  add_definitions( -D_DEBUG )
+  # MSVC doesn't like _DEBUG on release builds. See PR 4379.
+  if( NOT MSVC OR NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
+    add_definitions( -D_DEBUG )
+  endif()
   # On Release builds cmake automatically defines NDEBUG, so we
   # explicitly undefine it:
   if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )