From 48904e0cb76aad29f2cc79b7ccee17d98ac09cca Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Thu, 16 Jun 2011 22:19:20 +0000 Subject: [PATCH] Added LLVM_BUILD_MODE to cmake so that lit supports tests with REQUIRES: {buildmode}. llvm-svn: 133205 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 5 +++++ llvm/test/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index d0427acbd5dc..e72568426178 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -36,8 +36,13 @@ if( LLVM_ENABLE_ASSERTIONS ) # explicitly undefine it: if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) add_definitions( -UNDEBUG ) + set(LLVM_BUILD_MODE "Release") + else() + set(LLVM_BUILD_MODE "Debug") endif() + set(LLVM_BUILD_MODE "${LLVM_BUILD_MODE}+Asserts") else() + set(LLVM_BUILD_MODE "Release") if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) if( NOT MSVC_IDE AND NOT XCODE ) add_definitions( -DNDEBUG ) diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt index 993b6e274443..82eac606427b 100644 --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -71,7 +71,7 @@ if(PYTHONINTERP_FOUND) MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit) # Configuration-time: See Unit/lit.site.cfg.in - set(LLVM_BUILD_MODE "%(build_mode)s") + set(LLVM_BUILD_MODE "${LLVM_BUILD_MODE}") set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}) set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})