[runtimes] Calculate the path to the llvm directory without the LLVM cmake package

If building by pointing cmake directly at the llvm-project/runtimes
directory, the llvm cmake package files (that provide e.g.
LLVM_BUILD_MAIN_SRC_DIR) aren't necessarily available. Instead just
use a path relative to the current source dir.

Differential Revision: https://reviews.llvm.org/D109717
This commit is contained in:
Martin Storsjö 2021-09-13 22:27:44 +03:00
parent 61f22f70ca
commit 5b007f2c94
1 changed files with 2 additions and 2 deletions

View File

@ -75,11 +75,11 @@ set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR})
# This variable makes sure that e.g. llvm-lit is found.
set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../llvm)
set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
# This variable is used by individual runtimes to locate LLVM files.
set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR})
set(LLVM_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../llvm)
if(APPLE)
set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")