[Lldb-commits] [lldb] r309395 - [CMake] Add checks for libcompression

Chris Bieneman via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 28 08:39:52 PDT 2017


Author: cbieneman
Date: Fri Jul 28 08:39:51 2017
New Revision: 309395

URL: http://llvm.org/viewvc/llvm-project?rev=309395&view=rev
Log:
[CMake] Add checks for libcompression

This enables libcompression when available in the CMake build system.

Modified:
    lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
    lldb/trunk/include/lldb/Host/Config.h.cmake
    lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
    lldb/trunk/tools/debugserver/source/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=309395&r1=309394&r2=309395&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Fri Jul 28 08:39:51 2017
@@ -3,6 +3,7 @@
 include(CheckSymbolExists)
 include(CheckIncludeFile)
 include(CheckIncludeFiles)
+include(CheckLibraryExists)
 
 set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
 check_symbol_exists(ppoll poll.h HAVE_PPOLL)
@@ -21,6 +22,8 @@ check_cxx_source_compiles("
     int main() { return __NR_process_vm_readv; }"
     HAVE_NR_PROCESS_VM_READV)
 
+check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION)
+
 # These checks exist in LLVM's configuration, so I want to match the LLVM names
 # so that the check isn't duplicated, but we translate them into the LLDB names
 # so that I don't have to change all the uses at the moment.

Modified: lldb/trunk/include/lldb/Host/Config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=309395&r1=309394&r2=309395&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/Config.h.cmake (original)
+++ lldb/trunk/include/lldb/Host/Config.h.cmake Fri Jul 28 08:39:51 2017
@@ -24,4 +24,6 @@
 
 #cmakedefine01 HAVE_NR_PROCESS_VM_READV
 
+#cmakedefine HAVE_LIBCOMPRESSION
+
 #endif // #ifndef LLDB_HOST_CONFIG_H

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt?rev=309395&r1=309394&r2=309395&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt Fri Jul 28 08:39:51 2017
@@ -7,6 +7,10 @@ set(LLDB_PLUGINS
   lldbPluginPlatformMacOSX
 )
 
+if(HAVE_LIBCOMPRESSION)
+  set(LIBCOMPRESSION compression)
+endif()
+
 add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
   GDBRemoteClientBase.cpp
   GDBRemoteCommunication.cpp
@@ -30,6 +34,7 @@ add_lldb_library(lldbPluginProcessGDBRem
     lldbTarget
     lldbUtility
     ${LLDB_PLUGINS}
+    ${LIBCOMPRESSION}
   LINK_COMPONENTS
     Support
   )

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=309395&r1=309394&r2=309395&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Fri Jul 28 08:39:51 2017
@@ -1,4 +1,5 @@
 include(CheckCXXCompilerFlag)
+include(CheckLibraryExists)
 include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
 include_directories(${LLDB_SOURCE_DIR}/source)
 include_directories(MacOSX/DarwinLog)
@@ -26,6 +27,8 @@ if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof")
 endif ()
 
+check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION)
+
 add_subdirectory(MacOSX)
 
 set(generated_mach_interfaces
@@ -123,8 +126,12 @@ if(NOT SKIP_DEBUGSERVER)
                         ${MOBILESERVICES_LIBRARY}
                         ${LOCKDOWN_LIBRARY}
                         lldbDebugserverArchSupport
-                        lldbDebugserverDarwin_DarwinLog)
-
+                        lldbDebugserverDarwin_DarwinLog
+                        compression)
+  if(HAVE_LIBCOMPRESSION)
+    set_property(TARGET lldbDebugserverCommon APPEND PROPERTY
+                 COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
+  endif()
   set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources})
   add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
     debugserver.cpp
@@ -151,9 +158,14 @@ if(IOS)
                       ${CORE_FOUNDATION_LIBRARY}
                       ${FOUNDATION_LIBRARY}
                       lldbDebugserverArchSupport
-                      lldbDebugserverDarwin_DarwinLog)
+                      lldbDebugserverDarwin_DarwinLog
+                      compression)
+  if(HAVE_LIBCOMPRESSION)
+    set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY
+                 COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
+  endif()
 
-  add_lldb_tool(debugserver_nonui INCLUDE_IN_FRAMEWORK
+  add_lldb_tool(debugserver-nonui INCLUDE_IN_FRAMEWORK
     debugserver.cpp
 
     LINK_LIBS
@@ -183,7 +195,7 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STR
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
   )
   if(IOS)
-    add_custom_command(TARGET debugserver_nonui
+    add_custom_command(TARGET debugserver-nonui
       POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE}
               codesign --force --sign ${LLDB_CODESIGN_IDENTITY}




More information about the lldb-commits mailing list