1set(LLVM_TARGET_DEFINITIONS Options.td)
2tablegen(LLVM Options.inc -gen-opt-parser-defs)
3add_public_tablegen_target(LLDBOptionsTableGen)
4
5if(APPLE)
6  configure_file(
7    ${CMAKE_CURRENT_SOURCE_DIR}/lldb-Info.plist.in
8    ${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist
9    )
10  # Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available)
11  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist")
12endif()
13
14add_lldb_tool(lldb
15  Driver.cpp
16  Platform.cpp
17
18  LINK_LIBS
19    liblldb
20
21  LINK_COMPONENTS
22    Option
23    Support
24  )
25
26if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
27  add_definitions( -DIMPORT_LIBLLDB )
28endif()
29
30add_dependencies(lldb
31  LLDBOptionsTableGen
32  ${tablegen_deps}
33)
34
35set_target_properties(LLDBOptionsTableGen PROPERTIES FOLDER "lldb misc")
36
37if(LLDB_BUILD_FRAMEWORK)
38  # In the build-tree, we know the exact path to the framework directory.
39  # The installed framework can be in different locations.
40  lldb_setup_rpaths(lldb
41    BUILD_RPATH
42      "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}"
43    INSTALL_RPATH
44      "@loader_path/../../../SharedFrameworks"
45      "@loader_path/../../System/Library/PrivateFrameworks"
46      "@loader_path/../../Library/PrivateFrameworks"
47  )
48endif()
49