[clang] fd0b00b - [clang] [unitttests] Fix linking Basic test to LLVMTestingSupport
Michał Górny via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 13 14:01:37 PST 2021
Author: Michał Górny
Date: 2021-12-13T23:00:31+01:00
New Revision: fd0b00b5c60dcee1ac60e6121571e251fb242e63
URL: https://github.com/llvm/llvm-project/commit/fd0b00b5c60dcee1ac60e6121571e251fb242e63
DIFF: https://github.com/llvm/llvm-project/commit/fd0b00b5c60dcee1ac60e6121571e251fb242e63.diff
LOG: [clang] [unitttests] Fix linking Basic test to LLVMTestingSupport
Link BasicTests via explicit target_link_libraries() rather than
clang_target_link_libraries() in order to fix linking when building
clang against libclang-cpp. The latter requires all listed libraries
to be part of libclang-cpp and omits them if libclang-cpp is used.
However, LLVMTestingSupport is not part of libclang-cpp, so omitting it
causes undefined symbols. Link to the library explicitly to follow suit
with the 7 other unittest programs.
Differential Revision: https://reviews.llvm.org/D115580
Added:
Modified:
clang/unittests/Basic/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/unittests/Basic/CMakeLists.txt b/clang/unittests/Basic/CMakeLists.txt
index e633040eac153..b6f5d79e87c77 100644
--- a/clang/unittests/Basic/CMakeLists.txt
+++ b/clang/unittests/Basic/CMakeLists.txt
@@ -18,5 +18,9 @@ clang_target_link_libraries(BasicTests
clangAST
clangBasic
clangLex
- LLVMTestingSupport
)
+
+target_link_libraries(BasicTests
+ PRIVATE
+ LLVMTestingSupport
+)
More information about the cfe-commits
mailing list