Skip to content

Commit 2cec4d0

Browse files
mgornytstellar
authored andcommitted
Merging r371733:
------------------------------------------------------------------------ r371733 | mgorny | 2019-09-12 06:06:12 -0700 (Thu, 12 Sep 2019) | 7 lines [clang] [unittest] Import LLVMTestingSupport if necessary Add LLVMTestingSupport directory from LLVM_MAIN_SRC_DIR when building clang stand-alone and LLVMTestingSupport library is not present. This is needed to fix stand-alone builds without clang-tools-extra. Differential Revision: https://reviews.llvm.org/D67452 ------------------------------------------------------------------------
1 parent 933cfc6 commit 2cec4d0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/unittests/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
add_custom_target(ClangUnitTests)
22
set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests")
33

4+
if(CLANG_BUILT_STANDALONE)
5+
# LLVMTestingSupport library is needed for some of the unittests.
6+
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
7+
AND NOT TARGET LLVMTestingSupport)
8+
add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
9+
lib/Testing/Support)
10+
endif()
11+
endif()
12+
413
# add_clang_unittest(test_dirname file1.cpp file2.cpp)
514
#
615
# Will compile the list of files together and link against the clang

0 commit comments

Comments
 (0)