summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-14 18:23:07 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-14 18:23:07 +0000
commiteb4592b18d00ceb60b106a77bb74b4bb0ee7b5c9 (patch)
tree1ca18e18abbc38b30bc8d1c5d3dd1d6f25c523cb
parent6efab6eed778a637065a3358fcacd72113358871 (diff)
downloadbcm5719-llvm-eb4592b18d00ceb60b106a77bb74b4bb0ee7b5c9.tar.gz
bcm5719-llvm-eb4592b18d00ceb60b106a77bb74b4bb0ee7b5c9.zip
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. llvm-svn: 203955
-rw-r--r--lldb/CMakeLists.txt4
-rw-r--r--lldb/source/Host/macosx/CMakeLists.txt2
2 files changed, 4 insertions, 2 deletions
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 4cc4566890d..cf27eadcdde 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -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")
+ if (NOT LIBXML2_FOUND)
+ find_package(LibXml2)
+ endif ()
list(APPEND system_libs xml2 ncurses panel)
list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
diff --git a/lldb/source/Host/macosx/CMakeLists.txt b/lldb/source/Host/macosx/CMakeLists.txt
index 2b720897270..672c40a5212 100644
--- a/lldb/source/Host/macosx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/CMakeLists.txt
@@ -1,6 +1,6 @@
set(LLVM_NO_RTTI 1)
-include_directories(${LIBXML2_INCLUDE_DIR})
+include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
add_lldb_library(lldbHostMacOSX
Host.mm
OpenPOWER on IntegriCloud