[Polly] Don't use `llvm-config` anymore (in CMake sad path)

If `LLVM_BUILD_MAIN_SRC_DIR` is not defined, just assume we are in
regular monorepo layout. Non-standard (and not really supported) layouts
can still be configured manually.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D132314
This commit is contained in:
John Ericson 2022-08-20 17:38:05 -04:00
parent 6d8ddf53cc
commit 4c5114250b
1 changed files with 3 additions and 6 deletions

View File

@ -20,14 +20,11 @@ if(POLLY_STANDALONE_BUILD)
# Sources available, too?
if (LLVM_BUILD_MAIN_SRC_DIR)
set(LLVM_SOURCE_ROOT ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH
"Path to LLVM source tree")
set(default_llvm_src "${LLVM_BUILD_MAIN_SRC_DIR}")
else()
execute_process(COMMAND "${LLVM_TOOLS_BINARY_DIR}/llvm-config" --src-root
OUTPUT_VARIABLE MAIN_SRC_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_SOURCE_ROOT ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
set(default_llvm_src "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
endif()
set(LLVM_SOURCE_ROOT ${default_llvm_src} CACHE PATH "Path to LLVM source tree")
# Enable unit tests if available.
set(POLLY_GTEST_AVAIL 0)