1 #add_subdirectory(arm64)
5 add_subdirectory(x86_64)
6 add_subdirectory(DarwinLog)
8 include_directories(..)
10 set(generated_mach_interfaces
11 ${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h
12 ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
13 ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
15 add_custom_command(OUTPUT ${generated_mach_interfaces}
16 COMMAND mig ${CMAKE_CURRENT_SOURCE_DIR}/dbgnub-mig.defs
17 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dbgnub-mig.defs
20 set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c)
21 set_source_files_properties(${DEBUGSERVER_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
23 add_custom_command(OUTPUT ${DEBUGSERVER_VERS_GENERATED_FILE}
24 COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
25 ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj debugserver
26 > ${DEBUGSERVER_VERS_GENERATED_FILE}
27 DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
28 ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
31 set(DEBUGSERVER_USED_LIBS
34 lldbDebugserverMacOSX_I386
35 lldbDebugserverMacOSX_X86_64
36 lldbDebugserverMacOSX_DarwinLog
39 add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
52 ${generated_mach_interfaces}
53 ${DEBUGSERVER_VERS_GENERATED_FILE}
56 set_source_files_properties(
58 # Necessary since compilation will fail with stand-alone assembler
59 PROPERTIES LANGUAGE C COMPILE_FLAGS "-x assembler-with-cpp"
62 target_link_libraries(debugserver ${DEBUGSERVER_USED_LIBS})
64 set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
65 CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
66 if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))
68 COMMAND xcrun -f codesign_allocate
69 OUTPUT_STRIP_TRAILING_WHITESPACE
70 OUTPUT_VARIABLE CODESIGN_ALLOCATE
72 add_custom_command(TARGET debugserver
74 # Note: --entitlements option removed (see comment above).
75 COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE}
76 codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
77 $<TARGET_FILE:debugserver>
78 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin