Просмотр исходного кода

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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@161308 91177308-0d34-0410-b5e6-96231b3b80d8

Howard Hinnant 13 лет назад
Родитель
Сommit
e103a3d69b
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      CMakeLists.txt

+ 2 - 1
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)