1set(LLVM_TARGET_DEFINITIONS LLGSOptions.td)
2tablegen(LLVM LLGSOptions.inc -gen-opt-parser-defs)
3add_public_tablegen_target(LLGSOptionsTableGen)
4set_target_properties(LLGSOptionsTableGen PROPERTIES FOLDER "lldb misc")
5
6set(LLDB_PLUGINS)
7
8if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
9  list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)
10endif()
11
12if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
13  list(APPEND LLDB_PLUGINS
14    lldbPluginProcessFreeBSDRemote
15    lldbPluginProcessFreeBSD)
16endif()
17
18if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
19  list(APPEND LLDB_PLUGINS lldbPluginProcessNetBSD)
20endif()
21
22if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
23  list(APPEND LLDB_PLUGINS lldbPluginObjectFileMachO)
24elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
25  list(APPEND LLDB_PLUGINS lldbPluginObjectFilePECOFF)
26else()
27  list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF)
28endif()
29
30if(APPLE_EMBEDDED)
31  if(LLDB_CODESIGN_IDENTITY)
32    # Use explicit LLDB identity
33    set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY})
34  else()
35    # Use explicit LLVM identity or default to lldb_codesign if empty
36    if(NOT LLVM_CODESIGNING_IDENTITY)
37      set(LLVM_CODESIGNING_IDENTITY lldb_codesign)
38    endif()
39  endif()
40endif()
41
42add_lldb_tool(lldb-server
43    Acceptor.cpp
44    lldb-gdbserver.cpp
45    lldb-platform.cpp
46    lldb-server.cpp
47    LLDBServerUtilities.cpp
48    SystemInitializerLLGS.cpp
49
50    LINK_LIBS
51      lldbBase
52      lldbHost
53      lldbInitialization
54      ${LLDB_PLUGINS}
55      lldbPluginInstructionARM
56      lldbPluginInstructionMIPS
57      lldbPluginInstructionMIPS64
58      ${LLDB_SYSTEM_LIBS}
59
60    LINK_COMPONENTS
61      Option
62      Support
63)
64
65add_dependencies(lldb-server
66  LLGSOptionsTableGen
67  ${tablegen_deps}
68)
69target_include_directories(lldb-server PRIVATE "${LLDB_SOURCE_DIR}/source")
70target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})
71