SixWeining created this revision. SixWeining added reviewers: cfe-commits, dexonsmith. Herald added a subscriber: mgorny. SixWeining requested review of this revision. Herald added a project: clang.
Currently the clang/unittests/Basic/CMakeLists.txt links LLVMTestingSupport in an incorrect way that would cause `ninja check-clang` failing with a linking error like below: /usr/bin/ld: tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileManagerTest.cpp.o: in function `(anonymous namespace)::FileManagerTest_getBypassFile_Test::TestBody()': FileManagerTest.cpp:(.text._ZN12_GLOBAL__N_134FileManagerTest_getBypassFile_Test8TestBodyEv+0x3a3): undefined reference to `llvm::detail::TakeError(llvm::Error)' This patch changes the linking method of LLVMTestingSupport from clang_target_link_libraries to target_link_libraries just like other tests do. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D114505 Files: clang/unittests/Basic/CMakeLists.txt Index: clang/unittests/Basic/CMakeLists.txt =================================================================== --- clang/unittests/Basic/CMakeLists.txt +++ clang/unittests/Basic/CMakeLists.txt @@ -18,5 +18,9 @@ clangAST clangBasic clangLex - LLVMTestingSupport ) + +target_link_libraries(BasicTests + PRIVATE + LLVMTestingSupport +)
Index: clang/unittests/Basic/CMakeLists.txt =================================================================== --- clang/unittests/Basic/CMakeLists.txt +++ clang/unittests/Basic/CMakeLists.txt @@ -18,5 +18,9 @@ clangAST clangBasic clangLex - LLVMTestingSupport ) + +target_link_libraries(BasicTests + PRIVATE + LLVMTestingSupport +)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits