[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / tools / lldb-dap / CMakeLists.txt
blobd68098bf7b32664fd813acafbaed2c0c15bc4a55
1 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
2   list(APPEND extra_libs lldbHost)
3 endif ()
5 if (HAVE_LIBPTHREAD)
6   list(APPEND extra_libs pthread)
7 endif ()
10 if(APPLE)
11   configure_file(
12     ${CMAKE_CURRENT_SOURCE_DIR}/lldb-dap-Info.plist.in
13     ${CMAKE_CURRENT_BINARY_DIR}/lldb-dap-Info.plist
14     )
15   # Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available)
16   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-dap-Info.plist")
17 endif()
19 # We need to include the llvm components we depend on manually, as liblldb does
20 # not re-export those.
21 set(LLVM_LINK_COMPONENTS Support)
22 set(LLVM_TARGET_DEFINITIONS Options.td)
23 tablegen(LLVM Options.inc -gen-opt-parser-defs)
24 add_public_tablegen_target(LLDBDAPOptionsTableGen)
25 add_lldb_tool(lldb-dap
26   lldb-dap.cpp
27   Breakpoint.cpp
28   BreakpointBase.cpp
29   ExceptionBreakpoint.cpp
30   FifoFiles.cpp
31   FunctionBreakpoint.cpp
32   IOStream.cpp
33   JSONUtils.cpp
34   LLDBUtils.cpp
35   OutputRedirector.cpp
36   ProgressEvent.cpp
37   RunInTerminal.cpp
38   SourceBreakpoint.cpp
39   DAP.cpp
40   Watchpoint.cpp
41   InstructionBreakpoint.cpp
43   LINK_LIBS
44     liblldb
45     ${extra_libs}
47   LINK_COMPONENTS
48     Option
49     Support
50   )
52 if(LLDB_DAP_WELCOME_MESSAGE)
53   target_compile_definitions(lldb-dap
54     PRIVATE
55     -DLLDB_DAP_WELCOME_MESSAGE=\"${LLDB_DAP_WELCOME_MESSAGE}\")
56 endif()
58 if(LLDB_BUILD_FRAMEWORK)
59   # In the build-tree, we know the exact path to the framework directory.
60   # The installed framework can be in different locations.
61   lldb_setup_rpaths(lldb-dap
62     BUILD_RPATH
63       "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}"
64     INSTALL_RPATH
65       "@loader_path/../../../SharedFrameworks"
66       "@loader_path/../../System/Library/PrivateFrameworks"
67       "@loader_path/../../Library/PrivateFrameworks"
68   )
69 endif()