aboutsummaryrefslogtreecommitdiff
path: root/tools/lldb-server/CMakeLists.txt
blob: c82be8a2beb30a205da326ba51187037b2d85773 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
include_directories(
  ../../../../llvm/include
  ../../source/Plugins/Process/Linux
  ../../source/Plugins/Process/POSIX
  )
endif ()

if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
include_directories(
  ../../../../llvm/include
  ../../source/Plugins/Process/FreeBSD
  ../../source/Plugins/Process/POSIX
  )
endif ()

if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
include_directories(
  ../../../../llvm/include
  ../../source/Plugins/Process/POSIX
  )
endif ()

include_directories(../../source)

include(../../cmake/LLDBDependencies.cmake)

add_lldb_executable(lldb-server
    Acceptor.cpp
    lldb-gdbserver.cpp
    lldb-platform.cpp
    lldb-server.cpp
    LLDBServerUtilities.cpp
)

if (BUILD_SHARED_LIBS )
  target_link_libraries(lldb-server liblldb)
  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
else()
  # The Darwin linker doesn't understand --start-group/--end-group.
  if (LLDB_LINKER_SUPPORTS_GROUPS)
    target_link_libraries(lldb-server
                          -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
    target_link_libraries(lldb-server
                          -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
  else()
    target_link_libraries(lldb-server ${LLDB_USED_LIBS})
    target_link_libraries(lldb-server ${CLANG_USED_LIBS})
  endif()
  llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})

  target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
endif()

set_target_properties(lldb-server PROPERTIES VERSION ${LLDB_VERSION})

install(TARGETS lldb-server
  RUNTIME DESTINATION bin)