From aacb57ada46d8210aed56daa07445daa07aeba0f Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 5 Dec 2023 14:28:02 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75a4a84e..34e0c65c 100644 --- a/CMakeLists.txt +++ b/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)