From 285c82122d2b3492000011125a4d2542a70ba1f8 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Mon, 21 Jul 2014 14:17:15 +0000 Subject: [PATCH] Export LLVM_ENABLE_ASSERTIONS in LLVMConfig.cmake so clients know if the version of LLVM they are trying to use was built with or without assertions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213532 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/CMakeLists.txt | 1 - cmake/modules/LLVMConfig.cmake.in | 2 ++ cmake/modules/Makefile | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt index 08aeeb9a92e9..f7c54f2c0bd3 100644 --- a/cmake/modules/CMakeLists.txt +++ b/cmake/modules/CMakeLists.txt @@ -17,7 +17,6 @@ endforeach(lib) set(LLVM_CONFIG_CODE " # LLVM_BUILD_* values available only from LLVM build tree. set(LLVM_BUILD_BINARY_DIR \"${LLVM_BINARY_DIR}\") -set(LLVM_BUILD_ENABLE_ASSERTIONS \"${LLVM_ENABLE_ASSERTIONS}\") set(LLVM_BUILD_LIBRARY_DIR \"${LLVM_LIBRARY_DIR}\") set(LLVM_BUILD_MAIN_INCLUDE_DIR \"${LLVM_MAIN_INCLUDE_DIR}\") set(LLVM_BUILD_MAIN_SRC_DIR \"${LLVM_MAIN_SRC_DIR}\") diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in index 780001a1e8d2..dca54845f340 100644 --- a/cmake/modules/LLVMConfig.cmake.in +++ b/cmake/modules/LLVMConfig.cmake.in @@ -21,6 +21,8 @@ set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@) set(TARGET_TRIPLE "@TARGET_TRIPLE@") +set(LLVM_ENABLE_ASSERTIONS @LLVM_ENABLE_ASSERTIONS@) + set(LLVM_ENABLE_TERMINFO @LLVM_ENABLE_TERMINFO@) set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@) diff --git a/cmake/modules/Makefile b/cmake/modules/Makefile index 265c1f8ec14b..b8fe20e7c619 100644 --- a/cmake/modules/Makefile +++ b/cmake/modules/Makefile @@ -15,6 +15,12 @@ include $(LEVEL)/Makefile.common PROJ_cmake := $(DESTDIR)$(PROJ_prefix)/share/llvm/cmake +ifeq ($(DISABLE_ASSERTIONS),1) + LLVM_ENABLE_ASSERTIONS := 0 +else + LLVM_ENABLE_ASSERTIONS := 1 +endif + OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in $(LLVMBuildCMakeFrag) @@ -32,6 +38,7 @@ $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in $(LLVMBuildCMakeFrag) -e 's/@LLVM_TARGETS_TO_BUILD@/'"$(TARGETS_TO_BUILD)"'/' \ -e 's/@LLVM_TARGETS_WITH_JIT@/'"$(TARGETS_WITH_JIT)"'/' \ -e 's/@TARGET_TRIPLE@/'"$(TARGET_TRIPLE)"'/' \ + -e 's/@LLVM_ENABLE_ASSERTIONS@/'"$(LLVM_ENABLE_ASSERTIONS)"'/' \ -e 's/@LLVM_ENABLE_TERMINFO@/'"$(ENABLE_TERMINFO)"'/' \ -e 's/@LLVM_ENABLE_THREADS@/'"$(ENABLE_THREADS)"'/' \ -e 's/@LLVM_ENABLE_ZLIB@/'"$(ENABLE_ZLIB)"'/' \