summaryrefslogtreecommitdiff
path: root/sys-devel/clang/files/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch
blob: 67ae5a8e4dcf094ae898334b1a12d01410897935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From bfb5b0cb86cf90d9fa794f873644aa642b652c43 Mon Sep 17 00:00:00 2001
From: Michal Gorny <mgorny@gentoo.org>
Date: Thu, 12 Sep 2019 13:06:12 +0000
Subject: [PATCH] [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

llvm-svn: 371733
---
 clang/unittests/CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 9a41000cf43..4c222e24599 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -1,6 +1,15 @@
 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.
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
+      AND NOT TARGET LLVMTestingSupport)
+    add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
+      lib/Testing/Support)
+  endif()
+endif()
+
 # add_clang_unittest(test_dirname file1.cpp file2.cpp)
 #
 # Will compile the list of files together and link against the clang
-- 
2.23.0