From: Michał Górny Date: Tue, 24 Jan 2023 11:36:09 +0000 (+0100) Subject: [clang] Fix linking to LLVMTestingAnnotations in standalone build X-Git-Tag: upstream/17.0.6~19827 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f8b995b63620c3eb57610f958f66691d38d7185;p=platform%2Fupstream%2Fllvm.git [clang] Fix linking to LLVMTestingAnnotations in standalone build The LLVMTestingAnnotations library that is now used by unittests is not installed as part of LLVM. In order to make it possible to build unittests when performing the standalone build of clang, build the library from LLVM sources locally. This mirrors the existing logic for LLVMTestingSupport. Differential Revision: https://reviews.llvm.org/D142449 --- diff --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt index cffd475..f4e4f58 100644 --- a/clang/unittests/CMakeLists.txt +++ b/clang/unittests/CMakeLists.txt @@ -2,7 +2,12 @@ add_custom_target(ClangUnitTests) set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests") if(CLANG_BUILT_STANDALONE) - # LLVMTestingSupport library is needed for some of the unittests. + # LLVMTesting* libraries are needed for some of the unittests. + if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations + AND NOT TARGET LLVMTestingAnnotations) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations + lib/Testing/Annotations) + endif() if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support AND NOT TARGET LLVMTestingSupport) add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support