From 73984be05773e353fb0a87b63c1fc4a8b0f23a06 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 5 Aug 2012 17:37:39 +0000 Subject: [PATCH] Andrew Morrow: The current CMake setup for libc++ incorrectly uses the variable LLVM_ENABLE_ASSERTIONS instead of LIBCXX_ENABLE_ASSERTIONS when figuring out what _DEBUG/NDEBUG defines to set. It also tries to test the non-existent variable 'uppercase_CMAKE_BUILD_TYPE', which the top level LLVM CMakeLists.txt sets up, but which the top level libc++ CMakeLists.txt currently does not. Changing the variable name tested and creating the uppercase release name variable allows libc++ to honor the LIBCXX_ENABLE_ASSERTIONS option correctly. llvm-svn: 161308 --- libcxx/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 00ea48517821..ca8ad57d6c49 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -119,7 +119,8 @@ if (NOT LIBCXX_ENABLE_RTTI) append_if(LIBCXX_CXX_FEATURE_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG -fno-rtti) endif() # Assert -if (LLVM_ENABLE_ASSERTIONS) +string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) +if (LIBCXX_ENABLE_ASSERTIONS) # MSVC doesn't like _DEBUG on release builds. See PR 4379. if (NOT MSVC) list(APPEND LIBCXX_CXX_FEATURE_FLAGS -D_DEBUG)