This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix linking tests to LLVMTestingSupport
ClosedPublic

Authored by mgorny on Jan 28 2021, 5:18 PM.

Details

Summary

LLVMTestingSupport is not part of libLLVM, and therefore can not
be linked to via LLVM_LINK_COMPONENTS. Instead, it needs to be
specified explicitly to ensure that it is linked explicitly
even if LLVM_LINK_LLVM_DYLIB is used. This is consistent with handling
in clangd.

Fixes PR#48931

Diff Detail

Event Timeline

mgorny created this revision.Jan 28 2021, 5:18 PM
mgorny requested review of this revision.Jan 28 2021, 5:18 PM

I think I introduced this failure due to my abysmal knowledge of CMake and LLVM's library structure, So I'm definitely not qualified to say if this is a good fix, but seeing as it fixes the linker error I'll give it a tentative LG.

njames93 retitled this revision from [cte] [clang-tidy] Fix linking tests to LLVMTestingSupport to [clang-tidy] Fix linking tests to LLVMTestingSupport.Jan 28 2021, 7:16 PM
njames93 added a reviewer: alexfh.
njames93 added a project: Restricted Project.

I think I introduced this failure due to my abysmal knowledge of CMake and LLVM's library structure, So I'm definitely not qualified to say if this is a good fix, but seeing as it fixes the linker error I'll give it a tentative LG.

I'm a bit confused now. Are you telling that I should push it or wait for another review?

This revision is now accepted and ready to land.Jan 29 2021, 5:11 AM
njames93 added a comment.EditedJan 29 2021, 6:00 AM

I think I introduced this failure due to my abysmal knowledge of CMake and LLVM's library structure, So I'm definitely not qualified to say if this is a good fix, but seeing as it fixes the linker error I'll give it a tentative LG.

I'm a bit confused now. Are you telling that I should push it or wait for another review?

I was just saying wait for another reviewer to approve it. But it's all good now

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2021, 12:54 PM