Skip to content

Commit

Permalink
cmake: Don't do anything for LLVM_ENABLE_ASSERTIONS=OFF
Browse files Browse the repository at this point in the history
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!

llvm-svn: 211919
  • Loading branch information
rnk committed Jun 27, 2014
1 parent a67d14f commit 3260478
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3260478

Please sign in to comment.