Skip to content

[lldb/cmake] Implicitly pass arguments to llvm_add_library #142583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Jun 3, 2025

If we're not touching them, we don't need to do anything special to pass them along -- with one important caveat: due to how cmake arguments work, the implicitly passed arguments need to be specified before arguments that we handle.

This isn't particularly nice, but the alternative is enumerating all arguments that can be used by llvm_add_library and the macros it calls (it also relies on implicit passing of some arguments to llvm_process_sources).

If we're not touching them, we don't need to do anything special to pass
them along -- with one important caveat: due to how cmake arguments
work, the implicitly passed arguments need to be specified before
arguments that we handle.

This isn't particularly nice, but the alternative is enumerating all
arguments that can be used by llvm_add_library and the macros it calls
(it also relies on implicit passing of some arguments to
llvm_process_sources).
@llvmbot
Copy link
Member

llvmbot commented Jun 3, 2025

@llvm/pr-subscribers-lldb

@llvm/pr-subscribers-backend-hexagon

Author: Pavel Labath (labath)

Changes

If we're not touching them, we don't need to do anything special to pass them along -- with one important caveat: due to how cmake arguments work, the implicitly passed arguments need to be specified before arguments that we handle.

This isn't particularly nice, but the alternative is enumerating all arguments that can be used by llvm_add_library and the macros it calls (it also relies on implicit passing of some arguments to llvm_process_sources).


Patch is 76.95 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/142583.diff

128 Files Affected:

  • (modified) lldb/cmake/modules/AddLLDB.cmake (+3-17)
  • (modified) lldb/source/API/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Breakpoint/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Commands/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Core/CMakeLists.txt (+6-6)
  • (modified) lldb/source/DataFormatters/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Expression/CMakeLists.txt (+4-5)
  • (modified) lldb/source/Host/CMakeLists.txt (+3-4)
  • (modified) lldb/source/Host/macosx/objcxx/CMakeLists.txt (+3-4)
  • (modified) lldb/source/Initialization/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Interpreter/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Interpreter/Interfaces/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/ABI/AArch64/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/ARC/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/ARM/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/LoongArch/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/MSP430/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/Mips/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/RISCV/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ABI/X86/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Architecture/Arm/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Architecture/Mips/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt (+7-7)
  • (modified) lldb/source/Plugins/Instruction/ARM/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Instruction/LoongArch/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Instruction/RISCV/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/LanguageRuntime/ObjC/GNUstepObjCRuntime/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ObjectContainer/BSD-Archive/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ObjectFile/COFF/CMakeLists.txt (+5-5)
  • (modified) lldb/source/Plugins/ObjectFile/ELF/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/ObjectFile/JSON/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ObjectFile/Minidump/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ObjectFile/PDB/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/ObjectFile/Placeholder/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/ObjectFile/XCOFF/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/ObjectFile/wasm/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Platform/Android/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt (+3-4)
  • (modified) lldb/source/Plugins/Platform/QemuUser/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Platform/Windows/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/Process/AIX/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/FreeBSDKernel/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/Linux/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Process/NetBSD/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/POSIX/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/Utility/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/elf-core/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Process/mach-core/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/Process/minidump/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/Process/scripted/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Plugins/REPL/Clang/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/RegisterTypeBuilder/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Plugins/SymbolFile/Breakpad/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt (+5-5)
  • (modified) lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt (+3-3)
  • (modified) lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/TraceExporter/ctf/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/TypeSystem/Clang/CMakeLists.txt (+2-2)
  • (modified) lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt (+4-4)
  • (modified) lldb/source/Symbol/CMakeLists.txt (+2-3)
  • (modified) lldb/source/Target/CMakeLists.txt (+3-4)
  • (modified) lldb/source/Utility/CMakeLists.txt (+3-4)
  • (modified) lldb/source/ValueObject/CMakeLists.txt (+4-6)
  • (modified) lldb/tools/driver/CMakeLists.txt (+3-4)
  • (modified) lldb/tools/intel-features/intel-mpx/CMakeLists.txt (+2-3)
  • (modified) lldb/tools/lldb-dap/CMakeLists.txt (+3-4)
  • (modified) lldb/tools/lldb-instr/CMakeLists.txt (+2-3)
  • (modified) lldb/tools/lldb-server/CMakeLists.txt (+3-4)
  • (modified) lldb/tools/lldb-test/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/Breakpoint/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/Callback/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/Core/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/DAP/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/DataFormatter/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/Disassembler/CMakeLists.txt (+4-3)
  • (modified) lldb/unittests/Instruction/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/OperatingSystem/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/Platform/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/Process/elf-core/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/Process/gdb-remote/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/Process/minidump/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/SymbolFile/DWARF/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/SymbolFile/NativePDB/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/SymbolFile/PDB/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/Target/CMakeLists.txt (+2-2)
  • (modified) lldb/unittests/TestingSupport/CMakeLists.txt (+3-4)
  • (modified) lldb/unittests/TestingSupport/Symbol/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt (+4-3)
  • (modified) lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt (+4-3)
  • (modified) lldb/unittests/UnwindAssembly/x86-but-no-x86-target/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/UnwindAssembly/x86/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/Utility/CMakeLists.txt (+3-3)
  • (modified) lldb/unittests/ValueObject/CMakeLists.txt (+2-3)
  • (modified) lldb/unittests/debugserver/CMakeLists.txt (+4-4)
  • (modified) lldb/unittests/tools/lldb-server/tests/CMakeLists.txt (+2-2)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 3a9dcb79629b4..8b986bf037aac 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -38,14 +38,11 @@ function(add_lldb_library name)
     ${CMAKE_CURRENT_BINARY_DIR}
 )
 
-  # only supported parameters to this macro are the optional
-  # MODULE;SHARED;STATIC library type and source files
   cmake_parse_arguments(PARAM
     "MODULE;SHARED;STATIC;OBJECT;PLUGIN;FRAMEWORK;NO_INTERNAL_DEPENDENCIES;NO_PLUGIN_DEPENDENCIES"
-    "INSTALL_PREFIX;ENTITLEMENTS"
-    "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS;CLANG_LIBS"
+    "INSTALL_PREFIX"
+    "EXTRA_CXXFLAGS;LINK_LIBS;CLANG_LIBS"
     ${ARGN})
-  list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
 
   if(PARAM_NO_INTERNAL_DEPENDENCIES)
     foreach(link_lib ${PARAM_LINK_LIBS})
@@ -91,10 +88,6 @@ function(add_lldb_library name)
     set(libkind STATIC)
   endif()
 
-  if(PARAM_ENTITLEMENTS)
-    set(pass_ENTITLEMENTS ENTITLEMENTS ${PARAM_ENTITLEMENTS})
-  endif()
-
   if(LLDB_NO_INSTALL_DEFAULT_RPATH)
     set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
   endif()
@@ -102,8 +95,6 @@ function(add_lldb_library name)
   llvm_add_library(${name} ${libkind} ${headers}
     ${PARAM_UNPARSED_ARGUMENTS}
     LINK_LIBS ${PARAM_LINK_LIBS}
-    DEPENDS ${PARAM_DEPENDS}
-    ${pass_ENTITLEMENTS}
     ${pass_NO_INSTALL_RPATH}
   )
 
@@ -169,22 +160,17 @@ endfunction(add_lldb_library)
 function(add_lldb_executable name)
   cmake_parse_arguments(ARG
     "GENERATE_INSTALL"
-    "INSTALL_PREFIX;ENTITLEMENTS"
+    "INSTALL_PREFIX"
     "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS;BUILD_RPATH;INSTALL_RPATH"
     ${ARGN}
     )
 
-  if(ARG_ENTITLEMENTS)
-    set(pass_ENTITLEMENTS ENTITLEMENTS ${ARG_ENTITLEMENTS})
-  endif()
-
   if(LLDB_NO_INSTALL_DEFAULT_RPATH)
     set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
   endif()
 
   list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
   add_llvm_executable(${name}
-    ${pass_ENTITLEMENTS}
     ${pass_NO_INSTALL_RPATH}
     ${ARG_UNPARSED_ARGUMENTS}
   )
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 3bc569608e458..cb5f1f831dac0 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -128,6 +128,8 @@ add_lldb_library(liblldb SHARED ${option_framework}
   DEPENDS
     lldb-sbapi-dwarf-enums
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbBreakpoint
     lldbCore
@@ -142,8 +144,6 @@ add_lldb_library(liblldb SHARED ${option_framework}
     lldbValueObject
     lldbVersion
     ${LLDB_ALL_PLUGINS}
-  LINK_COMPONENTS
-    Support
 
   ${option_install_prefix}
 )
diff --git a/lldb/source/Breakpoint/CMakeLists.txt b/lldb/source/Breakpoint/CMakeLists.txt
index 6cd3c396a2c50..d8f8f8cbd055e 100644
--- a/lldb/source/Breakpoint/CMakeLists.txt
+++ b/lldb/source/Breakpoint/CMakeLists.txt
@@ -26,6 +26,8 @@ add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
   WatchpointOptions.cpp
   WatchpointResource.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbCore
     lldbExpression
@@ -34,7 +36,4 @@ add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
     lldbTarget
     lldbUtility
     lldbValueObject
-
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Commands/CMakeLists.txt b/lldb/source/Commands/CMakeLists.txt
index 71339ccd3a6ec..1ea51acec5f15 100644
--- a/lldb/source/Commands/CMakeLists.txt
+++ b/lldb/source/Commands/CMakeLists.txt
@@ -43,6 +43,8 @@ add_lldb_library(lldbCommands NO_PLUGIN_DEPENDENCIES
   CommandOptionsProcessAttach.cpp
   CommandOptionsProcessLaunch.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbBreakpoint
     lldbCore
@@ -55,9 +57,6 @@ add_lldb_library(lldbCommands NO_PLUGIN_DEPENDENCIES
     lldbUtility
     lldbValueObject
     lldbVersion
-
-  LINK_COMPONENTS
-    Support
   )
 
 add_dependencies(lldbCommands LLDBOptionsGen)
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index c4c442dcb2043..53dc031e90d11 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -60,6 +60,12 @@ add_lldb_library(lldbCore NO_PLUGIN_DEPENDENCIES
   DEPENDS
     clang-tablegen-targets
 
+
+  LINK_COMPONENTS
+    Support
+    Demangle
+    TargetParser
+    Telemetry
   LINK_LIBS
     lldbBreakpoint
     lldbDataFormatters
@@ -75,12 +81,6 @@ add_lldb_library(lldbCore NO_PLUGIN_DEPENDENCIES
 
   CLANG_LIBS
     clangDriver
-
-  LINK_COMPONENTS
-    Support
-    Demangle
-    TargetParser
-    Telemetry
   )
 
 add_dependencies(lldbCore
diff --git a/lldb/source/DataFormatters/CMakeLists.txt b/lldb/source/DataFormatters/CMakeLists.txt
index 91b10ba9e0ac8..097cbdb4526bc 100644
--- a/lldb/source/DataFormatters/CMakeLists.txt
+++ b/lldb/source/DataFormatters/CMakeLists.txt
@@ -18,6 +18,8 @@ add_lldb_library(lldbDataFormatters NO_PLUGIN_DEPENDENCIES
   ValueObjectPrinter.cpp
   VectorType.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbCore
     lldbInterpreter
@@ -25,7 +27,4 @@ add_lldb_library(lldbDataFormatters NO_PLUGIN_DEPENDENCIES
     lldbTarget
     lldbUtility
     lldbValueObject
-
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Expression/CMakeLists.txt b/lldb/source/Expression/CMakeLists.txt
index 9e1c341947e9d..ac129ce49b5d3 100644
--- a/lldb/source/Expression/CMakeLists.txt
+++ b/lldb/source/Expression/CMakeLists.txt
@@ -20,6 +20,10 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
   DEPENDS
   intrinsics_gen
 
+  LINK_COMPONENTS
+    Core
+    ExecutionEngine
+    Support
   LINK_LIBS
     lldbCore
     lldbHost
@@ -28,9 +32,4 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
     lldbTarget
     lldbUtility
     lldbValueObject
-
-  LINK_COMPONENTS
-    Core
-    ExecutionEngine
-    Support
   )
diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index 90814b1bed4c8..5a846f46ae2e3 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -176,14 +176,13 @@ endif()
 add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
   ${HOST_SOURCES}
 
+  LINK_COMPONENTS
+    Object
+    Support
   LINK_LIBS
     lldbUtility
     ${EXTRA_LIBS}
     ${LLDBObjCLibs}
     ${LLDB_LIBEDIT_LIBS}
-
-  LINK_COMPONENTS
-    Object
-    Support
   )
 
diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
index cda8269ca9efd..a55fc222bf5ad 100644
--- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -8,13 +8,12 @@ add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
   HostThreadMacOSX.mm
   MemoryMonitorMacOSX.mm
 
-  LINK_LIBS
-    lldbUtility
-    ${EXTRA_LIBS}
-
   LINK_COMPONENTS
     Support
     TargetParser
+  LINK_LIBS
+    lldbUtility
+    ${EXTRA_LIBS}
   )
 
 target_compile_options(lldbHostMacOSXObjCXX PRIVATE
diff --git a/lldb/source/Initialization/CMakeLists.txt b/lldb/source/Initialization/CMakeLists.txt
index b6282e162aa10..9b81facb2eebc 100644
--- a/lldb/source/Initialization/CMakeLists.txt
+++ b/lldb/source/Initialization/CMakeLists.txt
@@ -11,12 +11,12 @@ add_lldb_library(lldbInitialization
   SystemInitializer.cpp
   SystemLifetimeManager.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbCore
     lldbHost
     lldbPluginProcessGDBRemote
     ${EXTRA_PLUGINS}
     ${LLDB_SYSTEM_LIBS}
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt
index 642263a8bda7f..99e8ec7dfd57d 100644
--- a/lldb/source/Interpreter/CMakeLists.txt
+++ b/lldb/source/Interpreter/CMakeLists.txt
@@ -55,6 +55,8 @@ add_lldb_library(lldbInterpreter NO_PLUGIN_DEPENDENCIES
   Property.cpp
   ScriptInterpreter.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbInterpreterInterfaces
     lldbCommands
@@ -63,9 +65,6 @@ add_lldb_library(lldbInterpreter NO_PLUGIN_DEPENDENCIES
     lldbHost
     lldbTarget
     lldbUtility
-
-  LINK_COMPONENTS
-    Support
   )
 
 add_dependencies(lldbInterpreter
diff --git a/lldb/source/Interpreter/Interfaces/CMakeLists.txt b/lldb/source/Interpreter/Interfaces/CMakeLists.txt
index f44672aa50b75..8b0439883750f 100644
--- a/lldb/source/Interpreter/Interfaces/CMakeLists.txt
+++ b/lldb/source/Interpreter/Interfaces/CMakeLists.txt
@@ -1,10 +1,9 @@
 add_lldb_library(lldbInterpreterInterfaces NO_PLUGIN_DEPENDENCIES
   ScriptedInterfaceUsages.cpp
 
-  LINK_LIBS
-    lldbUtility
-
   LINK_COMPONENTS
     Support
+  LINK_LIBS
+    lldbUtility
   )
 
diff --git a/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt b/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
index e1e555249450e..f3bc7bcdc420a 100644
--- a/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
@@ -3,12 +3,12 @@ add_lldb_library(lldbPluginABIAArch64 PLUGIN
   ABIMacOSX_arm64.cpp
   ABISysV_arm64.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/ARC/CMakeLists.txt b/lldb/source/Plugins/ABI/ARC/CMakeLists.txt
index 8654461a6e7b1..bcaa3fffc30b5 100644
--- a/lldb/source/Plugins/ABI/ARC/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/ARC/CMakeLists.txt
@@ -1,13 +1,13 @@
 add_lldb_library(lldbPluginABIARC PLUGIN
   ABISysV_arc.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbPluginProcessUtility
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/ARM/CMakeLists.txt b/lldb/source/Plugins/ABI/ARM/CMakeLists.txt
index f73848947e5d4..e2ae014157f7c 100644
--- a/lldb/source/Plugins/ABI/ARM/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/ARM/CMakeLists.txt
@@ -3,13 +3,13 @@ add_lldb_library(lldbPluginABIARM PLUGIN
   ABIMacOSX_arm.cpp
   ABISysV_arm.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbPluginProcessUtility
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt b/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt
index 2bfc08d62a887..63b32c2c68f2e 100644
--- a/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt
@@ -1,12 +1,12 @@
 add_lldb_library(lldbPluginABIHexagon PLUGIN
   ABISysV_hexagon.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/LoongArch/CMakeLists.txt b/lldb/source/Plugins/ABI/LoongArch/CMakeLists.txt
index 11ac433f86003..a9a116549f802 100755
--- a/lldb/source/Plugins/ABI/LoongArch/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/LoongArch/CMakeLists.txt
@@ -1,12 +1,12 @@
 add_lldb_library(lldbPluginABILoongArch PLUGIN
   ABISysV_loongarch.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbPluginProcessUtility
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/MSP430/CMakeLists.txt b/lldb/source/Plugins/ABI/MSP430/CMakeLists.txt
index 6aff7a2f7bf2e..fd7bdb892c715 100644
--- a/lldb/source/Plugins/ABI/MSP430/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/MSP430/CMakeLists.txt
@@ -1,13 +1,13 @@
 add_lldb_library(lldbPluginABIMSP430 PLUGIN
   ABISysV_msp430.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
 
diff --git a/lldb/source/Plugins/ABI/Mips/CMakeLists.txt b/lldb/source/Plugins/ABI/Mips/CMakeLists.txt
index c7d0cc69d727f..42f2a97727718 100644
--- a/lldb/source/Plugins/ABI/Mips/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/Mips/CMakeLists.txt
@@ -3,12 +3,12 @@ add_lldb_library(lldbPluginABIMips PLUGIN
   ABISysV_mips.cpp
   ABISysV_mips64.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt b/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
index eff8cd664e4cf..bcb19bcf6dd4f 100644
--- a/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
@@ -3,13 +3,13 @@ add_lldb_library(lldbPluginABIPowerPC PLUGIN
   ABISysV_ppc.cpp
   ABISysV_ppc64.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbPluginTypeSystemClang
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/RISCV/CMakeLists.txt b/lldb/source/Plugins/ABI/RISCV/CMakeLists.txt
index 5b25bf7c6af82..68518eaaf9eeb 100755
--- a/lldb/source/Plugins/ABI/RISCV/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/RISCV/CMakeLists.txt
@@ -1,13 +1,13 @@
 add_lldb_library(lldbPluginABIRISCV PLUGIN
   ABISysV_riscv.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbPluginProcessUtility
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt b/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt
index b6164ed87d9db..c281fcef3c8f7 100644
--- a/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt
@@ -1,12 +1,12 @@
 add_lldb_library(lldbPluginABISystemZ PLUGIN
   ABISysV_s390x.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/ABI/X86/CMakeLists.txt b/lldb/source/Plugins/ABI/X86/CMakeLists.txt
index eeab6297e6f2d..3f4537e8d0584 100644
--- a/lldb/source/Plugins/ABI/X86/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/X86/CMakeLists.txt
@@ -6,12 +6,12 @@ add_lldb_library(lldbPluginABIX86 PLUGIN
   ABISysV_x86_64.cpp
   ABIWindows_x86_64.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbSymbol
     lldbTarget
     lldbValueObject
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt b/lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
index 9bcf99318622d..a762390196717 100644
--- a/lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
+++ b/lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
@@ -1,11 +1,11 @@
 add_lldb_library(lldbPluginArchitectureAArch64 PLUGIN
   ArchitectureAArch64.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbPluginProcessUtility
     lldbCore
     lldbTarget
     lldbUtility
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/Architecture/Arm/CMakeLists.txt b/lldb/source/Plugins/Architecture/Arm/CMakeLists.txt
index 60bbe69a99fbf..b47b285487b34 100644
--- a/lldb/source/Plugins/Architecture/Arm/CMakeLists.txt
+++ b/lldb/source/Plugins/Architecture/Arm/CMakeLists.txt
@@ -1,11 +1,11 @@
 add_lldb_library(lldbPluginArchitectureArm PLUGIN
   ArchitectureArm.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbPluginProcessUtility
     lldbCore
     lldbTarget
     lldbUtility
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/Architecture/Mips/CMakeLists.txt b/lldb/source/Plugins/Architecture/Mips/CMakeLists.txt
index 9734edc6b12bb..d4b67766ddc01 100644
--- a/lldb/source/Plugins/Architecture/Mips/CMakeLists.txt
+++ b/lldb/source/Plugins/Architecture/Mips/CMakeLists.txt
@@ -1,10 +1,10 @@
 add_lldb_library(lldbPluginArchitectureMips PLUGIN
   ArchitectureMips.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbCore
     lldbTarget
     lldbUtility
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt b/lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt
index 2cba112cf8827..1ca05281265ac 100644
--- a/lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt
+++ b/lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt
@@ -1,11 +1,11 @@
 add_lldb_library(lldbPluginArchitecturePPC64 PLUGIN
   ArchitecturePPC64.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbPluginProcessUtility
     lldbCore
     lldbTarget
     lldbUtility
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
index 60a091efe416f..b498389c21063 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
+++ b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
@@ -1,10 +1,6 @@
 add_lldb_library(lldbPluginDisassemblerLLVMC PLUGIN
   DisassemblerLLVMC.cpp
 
-  LINK_LIBS
-    lldbCore
-    lldbSymbol
-    lldbTarget
   LINK_COMPONENTS
     ${LLVM_TARGETS_TO_BUILD}
     MC
@@ -12,4 +8,8 @@ add_lldb_library(lldbPluginDisassemblerLLVMC PLUGIN
     RuntimeDyld
     Support
     TargetParser
+  LINK_LIBS
+    lldbCore
+    lldbSymbol
+    lldbTarget
   )
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt
index 7308374c8bfba..20fafb2816dcf 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt
@@ -3,6 +3,9 @@ add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
   DynamicLoaderMacOS.cpp
   DynamicLoaderDarwin.cpp
 
+  LINK_COMPONENTS
+    Support
+    TargetParser
   LINK_LIBS
     lldbBreakpoint
     lldbCore
@@ -12,7 +15,4 @@ add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
     lldbTarget
     lldbUtility
     lldbPluginTypeSystemClang
-  LINK_COMPONENTS
-    Support
-    TargetParser
   )
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
index c1e00b2dd444f..0ee25d7b38d13 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
@@ -2,6 +2,8 @@ add_lldb_library(lldbPluginDynamicLoaderPosixDYLD PLUGIN
   DYLDRendezvous.cpp
   DynamicLoaderPOSIXDYLD.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbBreakpoint
     lldbCore
@@ -10,6 +12,4 @@ add_lldb_library(lldbPluginDynamicLoaderPosixDYLD PLUGIN
     lldbTarget
     lldbPluginProcessElfCore
     lldbPluginProcessUtility
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
index 044d67c6619a6..4c2145714081c 100644
--- a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt
@@ -1,10 +1,10 @@
 add_lldb_library(lldbPluginDynamicLoaderWindowsDYLD PLUGIN
   DynamicLoaderWindowsDYLD.cpp
 
-  LINK_LIBS
-    lldbCore
-    lldbTarget
   LINK_COMPONENTS
     Support
     TargetParser
+  LINK_LIBS
+    lldbCore
+    lldbTarget
   )
diff --git a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt
index a4a4ac7b44e73..0adbcd081acb5 100644
--- a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt
@@ -1,9 +1,9 @@
 add_lldb_library(lldbPluginDynamicLoaderWasmDYLD PLUGIN
   DynamicLoaderWasmDYLD.cpp
 
+  LINK_COMPONENTS
+    Support
   LINK_LIBS
     lldbCore
     lldbTarget
-  LINK_COMPONENTS
-    Support
   )
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index 675cd066507bc..2aae7d13449d1 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -29,6 +29,13 @@ add_lldb_library(lldbPluginExpressionParserClang
   DEPENDS
   intrinsics_gen
 
+  LINK_COMPONENTS
+    Core
+    ExecutionEngine
+    ipo
+    MCJIT
+    Support
+    TargetParser
   LINK_LIBS
     lldbCore
     lldbExpression
@@ -54,11 +61,4 @@ add_lldb_library(lldbPluginExpressionParserClan...
[truncated]

@labath labath merged commit 2c4f677 into llvm:main Jun 4, 2025
14 checks passed
@JDevlieghere
Copy link
Member

JDevlieghere commented Jun 4, 2025

This appears to have broken the standalone build. I think we're no longer passing up the ENTITLEMENTS argument:

[2025-06-04T13:26:59.289Z] ld: library 'ENTITLEMENTS' not found
[2025-06-04T13:26:59.289Z] c++: error: linker command failed with exit code 1 (use -v to see invocation)

https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake-standalone/1782/

I'll take a look today.

edit: already fixed by 8f352f4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants