[Lldb-commits] [lldb] dfc2070 - [lldb] [utils] Fix linking lit-cpuid to LLVM dylib

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 26 10:03:37 PST 2022


Author: Michał Górny
Date: 2022-12-26T19:03:25+01:00
New Revision: dfc20708bcdf7b4c4bea8595fc4ac8674634d5e6

URL: https://github.com/llvm/llvm-project/commit/dfc20708bcdf7b4c4bea8595fc4ac8674634d5e6
DIFF: https://github.com/llvm/llvm-project/commit/dfc20708bcdf7b4c4bea8595fc4ac8674634d5e6.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/utils/lit-cpuid/CMakeLists.txt b/lldb/utils/lit-cpuid/CMakeLists.txt
index 630e81eaab09b..a151b986b551e 100644
--- a/lldb/utils/lit-cpuid/CMakeLists.txt
+++ b/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")


        


More information about the lldb-commits mailing list