summaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2021-08-11 14:14:31 +0300
committerMartin Storsjö <martin@martin.st>2021-09-09 15:30:42 +0300
commita3870e8ab164e796da4fe48c6abf899d79c09f6d (patch)
tree792446247cbec8e10d29a0fba725c3c1883c4a64 /libcxx
parent312ad74aea4886159472597ed6b2c40dea9e5ca7 (diff)
downloadllvm-a3870e8ab164e796da4fe48c6abf899d79c09f6d.tar.gz
Reapply [runtimes] Set more paths when building runtimes standalone
These paths are needed when building with per-target runtime directories. (It's possible to fix this by manually setting these when invoking cmake, but one isn't supposed to need to do that.) Also set LLVM_TOOLS_BINARY_DIR while touching this area (as it's also unset in this case) even if it isn't specifically needed by the per-target runtime configuration. Fixed since previous attempt: Don't check if the runtimes directory is the root of the CMake invocation; when the main LLVM CMake build builds runtimes, it does invoke a sub-CMake with this directory as the root too, just as if manually invoking CMake at the runtimes directory. Instead check whether LLVM_TOOLS_BINARY_DIR was set and whether find_package(LLVM) succeeded or not. Differential Revision: https://reviews.llvm.org/D107895
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
index ad2820b324d7..deaa2c3805f2 100644
--- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -14,6 +14,8 @@ set(LLVM_INCLUDE_DIR ${LLVM_PATH}/include CACHE PATH "Path to llvm/include")
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
+set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(LLVM_LIBRARY_OUTPUT_INTDIR "${CMAKE_CURRENT_BINARY_DIR}/lib")
if (EXISTS "${LLVM_CMAKE_PATH}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")