Author: Michał Górny Date: 2022-10-24T12:18:14+02:00 New Revision: d15239388cca8a5031119b4660e456c26ca5f379
URL: https://github.com/llvm/llvm-project/commit/d15239388cca8a5031119b4660e456c26ca5f379 DIFF: https://github.com/llvm/llvm-project/commit/d15239388cca8a5031119b4660e456c26ca5f379.diff LOG: [lldb] Add LLVM include dirs prior to gtest target in standalone build Move include_directories() declaration before gtest targets are created in standalone build. This fixes build failure due to gtest targets being unable to find LLVM headers, e.g.: /var/tmp/portage/dev-util/lldb-16.0.0_pre20221023/work/llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h:43:10: fatal error: llvm/ADT/Optional.h: No such file or directory Differential Revision: https://reviews.llvm.org/D136552 Added: Modified: lldb/cmake/modules/LLDBStandalone.cmake Removed: ################################################################################ diff --git a/lldb/cmake/modules/LLDBStandalone.cmake b/lldb/cmake/modules/LLDBStandalone.cmake index 9cd3f1e8186ba..98a52969ba30f 100644 --- a/lldb/cmake/modules/LLDBStandalone.cmake +++ b/lldb/cmake/modules/LLDBStandalone.cmake @@ -97,6 +97,12 @@ include(LLVMDistributionSupport) set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") set(LLVM_INCLUDE_TESTS ON CACHE INTERNAL "") +set(CMAKE_INCLUDE_CURRENT_DIR ON) +include_directories( + "${CMAKE_BINARY_DIR}/include" + "${LLVM_INCLUDE_DIRS}" + "${CLANG_INCLUDE_DIRS}") + # Build the gtest library needed for unittests, if we have LLVM sources # handy. if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest AND NOT TARGET llvm_gtest) @@ -117,12 +123,6 @@ endif() set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "lldb misc") set_target_properties(intrinsics_gen PROPERTIES FOLDER "lldb misc") -set(CMAKE_INCLUDE_CURRENT_DIR ON) -include_directories( - "${CMAKE_BINARY_DIR}/include" - "${LLVM_INCLUDE_DIRS}" - "${CLANG_INCLUDE_DIRS}") - if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS) set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) endif() _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits