summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-20 16:39:25 +0000
committerChris Bieneman <beanz@apple.com>2015-10-20 16:39:25 +0000
commit5fd2cdb71e211c0a8ea37d64f3c995ae50a407f6 (patch)
tree9659f28fb635f6ce9d22b4aa88fa4e4a555942f9 /runtime
parent8f3d8be71a4878852ea5edc5723e8effea21572f (diff)
[CMake] Make external compiler-rt install scripts relative to CMAKE_INSTALL_PREFIX.
This change makes LLVM_BUILD_EXTERNAL_COMPILER_RT work correctly when overriding CMAKE_INSTALL_PREFIX on the install action (which is how LLVM_CREATE_XCODE_TOOLCHAIN works). This fix is two parts: (1) Pass CMAKE_INSTALL_PREFIX in as a variable from the parent install to the child install (2) When passing COMPILER_RT_INSTALL_PATH into the external project make sure it is passed as a string not a path. Not specifying the full path for COMPILER_RT_INSTALL_PATH isn't enough to fix the issue because relative paths specified on the CMake command line are expanded relative to the working directory before the cache is populated. Forcing this to a string allows it to remain a relative path through to the install() calls. Relative paths specified in install() calls are expanded relative to CMAKE_INSTALL_PREFIX at install time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
-rw-r--r--runtime/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index d7ca3b66a0..1a015f05f9 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -66,7 +66,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
-DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config
-DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}
-DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR}
- -DCOMPILER_RT_INSTALL_PATH=${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
+ -DCOMPILER_RT_INSTALL_PATH:STRING=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
-DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
${COMPILER_RT_PASSTHROUGH_VARIABLES}
@@ -87,7 +87,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
add_dependencies(compiler-rt-configure clang llvm-config)
- install(CODE "execute_process\(COMMAND ${CMAKE_COMMAND} -P ${BINARY_DIR}/cmake_install.cmake \)"
+ install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${BINARY_DIR}/cmake_install.cmake \)"
COMPONENT compiler-rt)
add_custom_target(install-compiler-rt