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