[Lldb-commits] [lldb] 780d7d7 - [lldb] Allows customizing libxml2 for darwin

Haibo Huang via lldb-commits lldb-commits at lists.llvm.org
Wed May 20 12:29:20 PDT 2020


Author: Haibo Huang
Date: 2020-05-20T12:27:08-07:00
New Revision: 780d7d77327c3537cc2c2aa9314aa2ad92cfe070

URL: https://github.com/llvm/llvm-project/commit/780d7d77327c3537cc2c2aa9314aa2ad92cfe070
DIFF: https://github.com/llvm/llvm-project/commit/780d7d77327c3537cc2c2aa9314aa2ad92cfe070.diff

LOG: [lldb] Allows customizing libxml2 for darwin

Summary:
This changes allows to disable or use customized libxml2 for lldb.

1. Removes redundant include_directories. The one in LLDBConfig.cmake should be enough.

2. Link to ${LIBXML2_LIBRARIES} if xml2 is enabled.

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80257

Added: 
    

Modified: 
    lldb/cmake/modules/LLDBConfig.cmake
    lldb/source/Host/CMakeLists.txt
    lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
    lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
    lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 6b10f73eff19..c63e5316ccfc 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -286,7 +286,6 @@ if (APPLE)
        ${CORE_SERVICES_LIBRARY}
        ${SECURITY_LIBRARY}
        ${DEBUG_SYMBOLS_LIBRARY})
-  include_directories(${LIBXML2_INCLUDE_DIR})
 endif()
 
 if( WIN32 AND NOT CYGWIN )

diff  --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index a5e4e352d036..add503a5f36a 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -83,7 +83,6 @@ else()
     )
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-    include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
     add_subdirectory(macosx/objcxx)
     set(LLDBObjCLibs lldbHostMacOSXObjCXX)
     add_host_subdirectory(macosx
@@ -137,14 +136,10 @@ endif()
 set(EXTRA_LIBS)
 if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   list(APPEND EXTRA_LIBS kvm)
-endif ()
-if (APPLE)
-  list(APPEND EXTRA_LIBS xml2)
-else ()
-  if (LIBXML2_FOUND)
-    list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
-  endif()
-endif ()
+endif()
+if (LLDB_ENABLE_LIBXML2)
+  list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
+endif()
 if (HAVE_LIBDL)
   list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
 endif()
@@ -156,7 +151,7 @@ if (LLDB_ENABLE_LZMA)
 endif()
 if (WIN32)
   list(APPEND LLDB_SYSTEM_LIBS psapi)
-endif ()
+endif()
 
 if (LLDB_ENABLE_LIBEDIT)
   list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES})

diff  --git a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
index d5a84d87fcd9..447079712056 100644
--- a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -25,7 +25,6 @@ list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  include_directories(${LIBXML2_INCLUDE_DIR})
   add_subdirectory(objcxx)
   set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES

diff  --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
index 477f224b940d..448d032b381f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
@@ -6,10 +6,6 @@ lldb_tablegen(ProcessGDBRemotePropertiesEnum.inc -gen-lldb-property-enum-defs
   SOURCE ProcessGDBRemoteProperties.td
   TARGET LLDBPluginProcessGDBRemotePropertiesEnumGen)
 
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  include_directories(${LIBXML2_INCLUDE_DIR})
-endif()
-
 set(LLDB_PLUGINS
   lldbPluginProcessUtility
   lldbPluginPlatformMacOSX

diff  --git a/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt b/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt
index 8e82eae1513d..2cf185131238 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(${LIBXML2_INCLUDE_DIR})
-
 add_lldb_library(lldbPluginSymbolVendorMacOSX PLUGIN
   SymbolVendorMacOSX.cpp
 


        


More information about the lldb-commits mailing list