[cfe-commits] [libcxx] r161308 - /libcxx/trunk/CMakeLists.txt

Howard Hinnant hhinnant at apple.com
Sun Aug 5 10:37:39 PDT 2012


Author: hhinnant
Date: Sun Aug  5 12:37:39 2012
New Revision: 161308

URL: http://llvm.org/viewvc/llvm-project?rev=161308&view=rev
Log:
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.

Modified:
    libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=161308&r1=161307&r2=161308&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sun Aug  5 12:37:39 2012
@@ -119,7 +119,8 @@
   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)





More information about the cfe-commits mailing list