summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-09-13 20:49:25 +0000
committerZachary Turner <zturner@google.com>2017-09-13 20:49:25 +0000
commit90837bb59a2e12708c48f47e4c1dc425564c45b7 (patch)
treef9e245e0fb5a2d728ccc51f71f73021c35132e7a /CMakeLists.txt
parent9b8d2f223ddb502146a82f2711f97f616fddf331 (diff)
Revert "Determine up front which projects are enabled."
This was intended to be a generic CMake solution to a problem shared across several projects. It turns out it doesn't interact very well certain CMake configurations, and furthermore the "problem" is actually not a problem, as the problematic code is never executed to begin with. So this really isn't solving anything. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 21 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a5ac10d4..518428092 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -225,7 +225,7 @@ append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS)
# always respect the optimization flags set by CMAKE_BUILD_TYPE instead.
if (NOT MSVC)
- # Build with optimization, unless we're in debug mode.
+ # Build with optimization, unless we're in debug mode.
if(COMPILER_RT_DEBUG)
list(APPEND SANITIZER_COMMON_CFLAGS -O0)
else()
@@ -315,16 +315,28 @@ endif()
add_subdirectory(include)
-set(COMPILER_RT_HAS_LIBCXX_SOURCES ${LLVM_PROJECT_LIBCXX_ENABLED})
-if (LLVM_PROJECT_LIBCXX_ENABLED)
- set(COMPILER_RT_LIBCXX_PATH ${LLVM_PROJECT_LIBCXX_SOURCE_DIR})
- message("compiler-rt libcxx enabled at ${COMPILER_RT_LIBCXX_PATH}")
+set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx)
+if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/)
+ set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE)
+else()
+ set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/../libcxx)
+ if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/)
+ set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE)
+ else()
+ set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE)
+ endif()
endif()
-set(COMPILER_RT_HAS_LLD ${LLVM_PROJECT_LLD_ENABLED})
-if (LLVM_PROJECT_LLD_ENABLED)
- set(COMPILER_RT_LLD_PATH ${LLVM_PROJECT_LLD_SOURCE_DIR})
- message("compiler-rt lld enabled at ${COMPILER_RT_LLD_PATH}")
+set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)
+if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD)
+ set(COMPILER_RT_HAS_LLD TRUE)
+else()
+ set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/../lld)
+ if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD)
+ set(COMPILER_RT_HAS_LLD TRUE)
+ else()
+ set(COMPILER_RT_HAS_LLD FALSE)
+ endif()
endif()
pythonize_bool(COMPILER_RT_HAS_LLD)