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)
$<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()