[Lldb-commits] [lldb] r308378 - [CMake] A few fixups to support building LLDB for iOS

Chris Bieneman via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 18 14:15:53 PDT 2017


Author: cbieneman
Date: Tue Jul 18 14:15:53 2017
New Revision: 308378

URL: http://llvm.org/viewvc/llvm-project?rev=308378&view=rev
Log:
[CMake] A few fixups to support building LLDB for iOS

These changes enable proper configuration of LLDB targeting iOS.

Modified:
    lldb/trunk/cmake/modules/LLDBConfig.cmake
    lldb/trunk/source/Host/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=308378&r1=308377&r2=308378&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Jul 18 14:15:53 2017
@@ -10,15 +10,20 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
   set(LLDB_LINKER_SUPPORTS_GROUPS ON)
 endif()
 
+set(LLDB_DEFAULT_DISABLE_PYTHON 0)
+set(LLDB_DEFAULT_DISABLE_CURSES 0)
+
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  set(LLDB_DEFAULT_DISABLE_PYTHON 0)
   set(LLDB_DEFAULT_DISABLE_CURSES 1)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Android" )
   set(LLDB_DEFAULT_DISABLE_PYTHON 1)
   set(LLDB_DEFAULT_DISABLE_CURSES 1)
-else()
-  set(LLDB_DEFAULT_DISABLE_PYTHON 0)
-  set(LLDB_DEFAULT_DISABLE_CURSES 0)
+elseif(IOS)
+  set(LLDB_DEFAULT_DISABLE_PYTHON 1)
+endif()
+
+if(IOS)
+  add_definitions(-DNO_XPC_SERVICES)
 endif()
 
 set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL
@@ -298,13 +303,15 @@ if (NOT LIBXML2_FOUND AND NOT (CMAKE_SYS
 endif()
 
 # Find libraries or frameworks that may be needed
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  find_library(CARBON_LIBRARY Carbon)
+if (APPLE)
+  if(NOT IOS)
+    find_library(CARBON_LIBRARY Carbon)
+    find_library(CORE_SERVICES_LIBRARY CoreServices)
+    find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
+  endif()
   find_library(FOUNDATION_LIBRARY Foundation)
   find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
-  find_library(CORE_SERVICES_LIBRARY CoreServices)
   find_library(SECURITY_LIBRARY Security)
-  find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
 
   set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Output directory for LLDB.framework")
   set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)")
@@ -312,10 +319,13 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
     LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources)
 
   add_definitions( -DLIBXML2_DEFINED )
-  list(APPEND system_libs xml2 ${CURSES_LIBRARIES})
-  list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
-  ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
-  ${DEBUG_SYMBOLS_LIBRARY})
+  list(APPEND system_libs xml2
+       ${CURSES_LIBRARIES}
+       ${FOUNDATION_LIBRARY}
+       ${CORE_FOUNDATION_LIBRARY}
+       ${CORE_SERVICES_LIBRARY}
+       ${SECURITY_LIBRARY}
+       ${DEBUG_SYMBOLS_LIBRARY})
 
 else()
   if (LIBXML2_FOUND)

Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=308378&r1=308377&r2=308378&view=diff
==============================================================================
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Tue Jul 18 14:15:53 2017
@@ -103,6 +103,10 @@ else()
       macosx/cfcpp/CFCMutableSet.cpp
       macosx/cfcpp/CFCString.cpp
       )
+    if(IOS)
+      set_property(SOURCE macosx/Host.mm APPEND PROPERTY 
+               COMPILE_DEFINITIONS "NO_XPC_SERVICES=1")
+    endif()
 
 
   elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android")




More information about the lldb-commits mailing list