Skip to content

Commit 0dbbcb7

Browse files
committed
🍒 [lldb] Add build option to specify the libxml 2 version (llvm#142183)
The Swift Windows toolchain uses its own static build of libxml 2, which is more recent than 2.8, resulting in the provided libxml 2 to be rejected. This change allows to specify a custom version for libxml 2, while defaulting to 2.8. (cherry-picked from commit llvm/llvm-project@a080c74)
1 parent 16bde63 commit 0dbbcb7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ macro(add_optional_dependency variable description package found)
5151
message(STATUS "${description}: ${${variable}}")
5252
endmacro()
5353

54+
set(LLDB_LIBXML2_VERSION "2.8" CACHE STRING
55+
"Specify the version of libxml 2 to use with LLDB. This is only meant to be overridden for local
56+
static builds of libxml 2. Use at your own risk.")
57+
mark_as_advanced(LLDB_LIBXML2_VERSION)
58+
5459
add_optional_dependency(LLDB_ENABLE_SWIG "Enable SWIG to generate LLDB bindings" SWIG SWIG_FOUND VERSION 4)
5560

5661
# BEGIN SWIFT MOD
@@ -67,7 +72,7 @@ add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" Curse
6772
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
6873
add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND)
6974
add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND)
70-
add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8)
75+
add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION ${LLDB_LIBXML2_VERSION})
7176
add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in LLDB" FBSDVMCore FBSDVMCore_FOUND QUIET)
7277

7378
option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)

0 commit comments

Comments
 (0)