[Lldb-commits] [lldb] build: enable CONFIG mode search for LibXml2 for LLDB (PR #117615)

Evan Wilde via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 26 10:31:32 PST 2024


================
@@ -57,7 +57,17 @@ add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" Curse
 add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
 add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND)
 add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND)
-add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8)
+# LibXml2 is required if LLDB_ENABLE_LIBXML2 is ON or AUTO. The LibXml2 package
+# search is not setup properly to support the CONFIG mode search. Furthermore,
----------------
etcwilde wrote:

> In this case, by default, CMake first tries Module mode by searching for a Find<pkg>.cmake module. If it fails, CMake then searches for the package using Config mode.

- https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.html

The `FindLibXml2.cmake` module exists, so it's using that. If you use `CMAKE_FIND_PACKAGE_PREFER_CONFIG=YES`, it should go with your config file.

https://github.com/llvm/llvm-project/pull/117615


More information about the lldb-commits mailing list