[Lldb-commits] [clang] [lldb] [llvm] [cmake] Add support for statically linking libxml2 (PR #166867)
Petr Hosek via lldb-commits
lldb-commits at lists.llvm.org
Sun Nov 9 22:46:53 PST 2025
================
@@ -190,3 +190,8 @@ add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
${LLDB_LIBEDIT_LIBS}
)
+if (LLDB_ENABLE_LIBXML2 AND LLVM_USE_STATIC_LIBXML2)
+ target_link_libraries(lldbHost PRIVATE ${LIBXML2_LIBRARIES})
+ target_include_directories(lldbHost PUBLIC ${LIBXML2_INCLUDE_DIRS})
+ add_dependencies(lldbHost libxml2)
+endif()
----------------
petrhosek wrote:
The goal of using the interface libraries (like `LibXml2::LibXml2`) is to simplify our CMake code where we don't need to manually update the list include directories and link libraries and can instead depend on a single target, but this negates that benefit, even worse now we have to both depend on the interface target and manually update the list include directories and link libraries everywhere where we depend on libxml2.
https://github.com/llvm/llvm-project/pull/166867
More information about the lldb-commits
mailing list