Skip to content

Commit

Permalink
[clang] Fix linking to LLVMTestingAnnotations in standalone build
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mgorny committed Jan 24, 2023
1 parent 5265adc commit 0f8b995
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clang/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f8b995

Please sign in to comment.