mgorny created this revision.
mgorny added reviewers: labath, sylvestre.ledru, JDevlieghere, MaskRay.
Herald added subscribers: StephenFan, delcypher.
Herald added a project: All.
mgorny requested review of this revision.

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 
<https://reviews.llvm.org/rGf09cf34d00625e57dea5317a3ac0412c07292148>.


https://reviews.llvm.org/D140671

Files:
  lldb/utils/lit-cpuid/CMakeLists.txt


Index: lldb/utils/lit-cpuid/CMakeLists.txt
===================================================================
--- lldb/utils/lit-cpuid/CMakeLists.txt
+++ lldb/utils/lit-cpuid/CMakeLists.txt
@@ -1,6 +1,9 @@
 add_lldb_executable(lit-cpuid
   lit-cpuid.cpp
+
+  LINK_COMPONENTS
+    Support
+    TargetParser
   )
 
-target_link_libraries(lit-cpuid PRIVATE LLVMSupport LLVMTargetParser)
 set_target_properties(lit-cpuid PROPERTIES FOLDER "lldb utils")


Index: lldb/utils/lit-cpuid/CMakeLists.txt
===================================================================
--- lldb/utils/lit-cpuid/CMakeLists.txt
+++ lldb/utils/lit-cpuid/CMakeLists.txt
@@ -1,6 +1,9 @@
 add_lldb_executable(lit-cpuid
   lit-cpuid.cpp
+
+  LINK_COMPONENTS
+    Support
+    TargetParser
   )
 
-target_link_libraries(lit-cpuid PRIVATE LLVMSupport LLVMTargetParser)
 set_target_properties(lit-cpuid PROPERTIES FOLDER "lldb utils")
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to