[llvm] r211919 - cmake: Don't do anything for LLVM_ENABLE_ASSERTIONS=OFF

Reid Kleckner reid at kleckner.net
Fri Jun 27 11:17:30 PDT 2014


Author: rnk
Date: Fri Jun 27 13:17:30 2014
New Revision: 211919

URL: http://llvm.org/viewvc/llvm-project?rev=211919&view=rev
Log:
cmake: Don't do anything for LLVM_ENABLE_ASSERTIONS=OFF

By default, CMake will set NDEBUG in Rel* builds and leave it off in
debug builds, so we shouldn't need to do anything ourselves.

Before this change, it was possible to a Debug build without assertions
(aka Debug-Asserts in the autoconf system) by configuring with
-DLLVM_ENABLE_ASSERTIONS=OFF, but this configuration isn't very useful.
You can still get the same effect by explicitly adding -DNDEBUG to
CFLAGS.

Differential Revision: http://reviews.llvm.org/D4257

Patch by Janusz Sobczak!

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=211919&r1=211918&r2=211919&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Fri Jun 27 13:17:30 2014
@@ -67,12 +67,6 @@ if( LLVM_ENABLE_ASSERTIONS )
         "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
     endforeach()
   endif()
-else()
-  if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
-    if( NOT MSVC_IDE AND NOT XCODE )
-      add_definitions( -DNDEBUG )
-    endif()
-  endif()
 endif()
 
 if(WIN32)





More information about the llvm-commits mailing list