summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-13 18:17:30 +0000
committerChris Bieneman <beanz@apple.com>2015-10-13 18:17:30 +0000
commit10360cd85d96d629d41e8323df683201f46cf4b1 (patch)
tree377a1e13c72ad82efa5160bc5c20cb3019912853 /runtime
parent96497ca976174c33cca52f7e8292dd08bf9830fc (diff)
[CMake] When building clang as an external project we should pass through all variables that start with COMPILER_RT
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
-rw-r--r--runtime/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 6d75314ba7..d7ca3b66a0 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -44,6 +44,16 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
COMMENT "Clobberring compiler-rt build and stamp directories"
)
+ # Find all variables that start with COMPILER_RT and populate a variable with
+ # them.
+ get_cmake_property(variableNames VARIABLES)
+ foreach(varaibleName ${variableNames})
+ if(${varaibleName} MATCHES "^COMPILER_RT")
+ list(APPEND COMPILER_RT_PASSTHROUGH_VARIABLES
+ -D${varaibleName}=${${varaibleName}})
+ endif()
+ endforeach()
+
ExternalProject_Add(compiler-rt
PREFIX ${COMPILER_RT_PREFIX}
SOURCE_DIR ${COMPILER_RT_SRC_ROOT}
@@ -59,6 +69,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
-DCOMPILER_RT_INSTALL_PATH=${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
-DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+ ${COMPILER_RT_PASSTHROUGH_VARIABLES}
INSTALL_COMMAND ""
STEP_TARGETS configure build
${cmake_3_4_USES_TERMINAL_OPTIONS}