From 9b41ae8cb84e61c5d62bfff6663d053eecffbd86 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 5 Dec 2023 14:28:02 +0100 Subject: [PATCH] [cling] Provide fallback for LLVM_INCLUDE_DIRS In standalone builds, it could otherwise happen that the variable is not set during the first CMake invocation and tests fail because they are unable to locate the LLVM headers. --- interpreter/cling/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interpreter/cling/CMakeLists.txt b/interpreter/cling/CMakeLists.txt index 75a4a84ec6006..34e0c65cb000b 100644 --- a/interpreter/cling/CMakeLists.txt +++ b/interpreter/cling/CMakeLists.txt @@ -190,6 +190,9 @@ else() set (CLANG_INCLUDE_DIRS "${CLANG_INCLUDE_DIRS}" "${LLVM_BINARY_DIR}/tools/clang/include") endif() + if (NOT LLVM_INCLUDE_DIRS) + set (LLVM_INCLUDE_DIRS "${LLVM_MAIN_SRC_DIR}/include" "${LLVM_BINARY_DIR}/include") + endif() endif() if( NOT "NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)