[Lldb-commits] [lldb] [lldb] Enforce usage of LINK_COMPONENTS and CLANG_LIBS (PR #208860)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 10 17:01:34 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Alex Langford (bulbazord)
<details>
<summary>Changes</summary>
LINK_COMPONENTS and CLANG_LIBS exist to correctly support the LLVM/Clang dylib build configuration. Failure to enforce this will break LLDB when built against libLLVM.dylib.
---
Full diff: https://github.com/llvm/llvm-project/pull/208860.diff
1 Files Affected:
- (modified) lldb/cmake/modules/AddLLDB.cmake (+16)
``````````diff
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index fb49da3396a5c..b6ad8d46380b3 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -188,6 +188,22 @@ function(add_lldb_library name)
"LINK_LIBS;CLANG_LIBS;ALLOWED_INTERNAL_DEPENDENCIES"
${ARGN})
+ foreach(link_lib ${PARAM_LINK_LIBS})
+ # May not be a target yet.
+ if (NOT TARGET ${link_lib})
+ continue()
+ endif()
+
+ if (link_lib MATCHES "^clang")
+ message(FATAL_ERROR "Library ${name} links against clang library ${link_lib} via LINK_LIBS but must be added via CLANG_LIBS")
+ endif()
+
+ get_target_property(_is_llvm_component ${link_lib} LLVM_COMPONENT)
+ if (link_lib MATCHES "^LLVM" AND ${_is_llvm_component})
+ message(FATAL_ERROR "Library ${name} links against LLVM library ${link_lib} via LINK_LIBS but must be added via LINK_COMPONENTS")
+ endif()
+ endforeach()
+
set(_check_internal_deps FALSE)
if(PARAM_NO_INTERNAL_DEPENDENCIES)
set(_allowed_internal_deps "")
``````````
</details>
https://github.com/llvm/llvm-project/pull/208860
More information about the lldb-commits
mailing list