[lldb] [utils] Fix linking lit-cpuid to LLVM dylib
authorMichał Górny <mgorny@gentoo.org>
Mon, 26 Dec 2022 13:30:35 +0000 (14:30 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 26 Dec 2022 18:03:25 +0000 (19:03 +0100)
commitdfc20708bcdf7b4c4bea8595fc4ac8674634d5e6
tree82cefb68993df971bcc26cede989482ce50247dc
parent60359f56aaafac6adee5fa23932f790e6f19bf81
[lldb] [utils] Fix linking lit-cpuid to LLVM dylib

Use `LINK_COMPONENTS` instead of manual `target_link_libraries` to link
lit-cpuid to LLVM components.  This ensures that dylib is used along
with `LLVM_LINK_LLVM_DYLIB` rather than linking to component libraries
that may not be installed.

This fixes build failure on Gentoo after a dep on TargetParser component
was added in f09cf34d00625e57dea5317a3ac0412c07292148.

Differential Revision: https://reviews.llvm.org/D140671
lldb/utils/lit-cpuid/CMakeLists.txt