summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2017-07-25 20:31:53 +0000
committerChris Bieneman <beanz@apple.com>2017-07-25 20:31:53 +0000
commit09736e314c92d8ce73091b9883087299b6a68fe9 (patch)
treef5cba9a5021770510e680a7c1c12cb878782694d /lldb/tools/debugserver
parent3769777f11a3334e6d5904445940f600e6619162 (diff)
downloadbcm5719-llvm-09736e314c92d8ce73091b9883087299b6a68fe9.tar.gz
bcm5719-llvm-09736e314c92d8ce73091b9883087299b6a68fe9.zip
[CMake] Build debugserver & debugserver_nonui
When building for iOS we build two variants of debugserver. One which supports UI functionality like Springboard for launching applications, and one which does not. This patch adds support for building debugserver with and without UI support libraries being available. llvm-svn: 309026
Diffstat (limited to 'lldb/tools/debugserver')
-rw-r--r--lldb/tools/debugserver/source/CMakeLists.txt72
1 files changed, 64 insertions, 8 deletions
diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index f49d0fa1ac9..7c9df19ecd9 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -94,26 +94,72 @@ add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
if (APPLE)
if(IOS)
- find_library(COCOA_LIBRARY UIKit)
+ find_library(BACKBOARD_LIBRARY BackBoardServices
+ PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
+ find_library(FRONTBOARD_LIBRARY FrontBoardServices
+ PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
+ find_library(SPRINGBOARD_LIBRARY SpringBoardServices
+ PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
+ find_library(MOBILESERVICES_LIBRARY MobileCoreServices
+ PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
+ find_library(LOCKDOWN_LIBRARY lockdown)
+
+ if(NOT BACKBOARD_LIBRARY)
+ set(SKIP_DEBUGSERVER True)
+ endif()
else()
find_library(COCOA_LIBRARY Cocoa)
endif()
endif()
-target_link_libraries(lldbDebugserverCommon
+if(NOT SKIP_DEBUGSERVER)
+ target_link_libraries(lldbDebugserverCommon
+ INTERFACE ${COCOA_LIBRARY}
+ ${CORE_FOUNDATION_LIBRARY}
+ ${FOUNDATION_LIBRARY}
+ ${BACKBOARD_LIBRARY}
+ ${FRONTBOARD_LIBRARY}
+ ${SPRINGBOARD_LIBRARY}
+ ${MOBILESERVICES_LIBRARY}
+ ${LOCKDOWN_LIBRARY}
+ lldbDebugserverArchSupport
+ lldbDebugserverDarwin_DarwinLog)
+
+ set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources})
+ add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
+ debugserver.cpp
+
+ LINK_LIBS
+ lldbDebugserverCommon
+ )
+ if(IOS)
+ set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS
+ WITH_LOCKDOWN
+ WITH_FBS
+ WITH_BKS
+ )
+ set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS
+ -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
+ )
+ endif()
+endif()
+
+if(IOS)
+ add_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources})
+ target_link_libraries(lldbDebugserverCommon_NonUI
INTERFACE ${COCOA_LIBRARY}
${CORE_FOUNDATION_LIBRARY}
${FOUNDATION_LIBRARY}
lldbDebugserverArchSupport
lldbDebugserverDarwin_DarwinLog)
-set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources})
-add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
- debugserver.cpp
+ add_lldb_tool(debugserver_nonui INCLUDE_IN_FRAMEWORK
+ debugserver.cpp
- LINK_LIBS
- lldbDebugserverCommon
- )
+ LINK_LIBS
+ lldbDebugserverCommon_NonUI
+ )
+endif()
set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-macosx-entitlements.plist)
if(IOS)
@@ -136,6 +182,16 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))
$<TARGET_FILE:debugserver>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
+ if(IOS)
+ add_custom_command(TARGET debugserver_nonui
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE}
+ codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
+ --entitlements ${entitlements_xml}
+ $<TARGET_FILE:debugserver>
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+ )
+ endif()
endif()
OpenPOWER on IntegriCloud