From 10360cd85d96d629d41e8323df683201f46cf4b1 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 13 Oct 2015 18:17:30 +0000 Subject: [PATCH] [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 --- runtime/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) 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} -- 2.50.1