[Lldb-commits] [lldb] r203955 - build: fix libxml2 detection via CMake

Saleem Abdulrasool compnerd at compnerd.org
Fri Mar 14 11:23:07 PDT 2014

Author: compnerd
Date: Fri Mar 14 13:23:07 2014
New Revision: 203955

URL: http://llvm.org/viewvc/llvm-project?rev=203955&view=rev
build: fix libxml2 detection via CMake

libxml2's include path was unconditionally set to /usr/include/libxml2.  This
would work previously, however, Mavericks removed the /usr/include directory.
Since LLDB already requires clang, which via LLVM's build infrastructure
searches for libxml2, we have a proper include path for libxml2.  If
LIBXML2_FOUND is set, do not touch the libxml2 search path.  Instead, allow the
clang's definition to propagate throughout the LLVM build.  Otherwise, switch to
find_package(LibXml2) as clang does.  This will ensure that the correct path is
used for libxml2 irrespective of the platform.

Furthermore, treat libxml2 as a system provided library.  It is not part of the
LLVM source base so it is of little value to enable all warnings on its headers.
This unifies the treatment of libxml2 across clang and LLDB.


Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=203955&r1=203954&r2=203955&view=diff
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Fri Mar 14 13:23:07 2014
@@ -260,7 +260,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   find_library(SECURITY_LIBRARY Security)
   find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
-  set(LIBXML2_INCLUDE_DIR "/usr/include/libxml2")
+    find_package(LibXml2)
+  endif ()
   list(APPEND system_libs xml2 ncurses panel)

Modified: lldb/trunk/source/Host/macosx/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/CMakeLists.txt?rev=203955&r1=203954&r2=203955&view=diff
--- lldb/trunk/source/Host/macosx/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/macosx/CMakeLists.txt Fri Mar 14 13:23:07 2014
@@ -1,6 +1,6 @@
 set(LLVM_NO_RTTI 1)
+include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})

More information about the lldb-commits mailing list