mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
[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. llvm-svn: 250834
This commit is contained in:
parent
cdaab620d2
commit
38b2dec37e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user