2018-08-17 01:59:38 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
|
|
|
|
add_definitions( -DIMPORT_LIBLLDB )
|
|
|
|
list(APPEND extra_libs lldbHost)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (HAVE_LIBPTHREAD)
|
|
|
|
list(APPEND extra_libs pthread)
|
|
|
|
endif ()
|
|
|
|
|
2019-11-16 01:46:27 +08:00
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lldb-vscode-Info.plist.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist
|
|
|
|
)
|
|
|
|
# Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist")
|
|
|
|
endif()
|
|
|
|
|
2018-08-17 01:59:38 +08:00
|
|
|
# We need to include the llvm components we depend on manually, as liblldb does
|
|
|
|
# not re-export those.
|
|
|
|
set(LLVM_LINK_COMPONENTS Support)
|
2020-02-22 00:13:05 +08:00
|
|
|
set(LLVM_TARGET_DEFINITIONS Options.td)
|
|
|
|
tablegen(LLVM Options.inc -gen-opt-parser-defs)
|
|
|
|
add_public_tablegen_target(LLDBVSCodeOptionsTableGen)
|
2018-08-17 01:59:38 +08:00
|
|
|
add_lldb_tool(lldb-vscode
|
|
|
|
lldb-vscode.cpp
|
|
|
|
BreakpointBase.cpp
|
|
|
|
ExceptionBreakpoint.cpp
|
|
|
|
FunctionBreakpoint.cpp
|
2019-03-08 05:23:21 +08:00
|
|
|
IOStream.cpp
|
2018-08-17 01:59:38 +08:00
|
|
|
JSONUtils.cpp
|
|
|
|
LLDBUtils.cpp
|
|
|
|
SourceBreakpoint.cpp
|
|
|
|
VSCode.cpp
|
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
liblldb
|
|
|
|
${host_lib}
|
|
|
|
${extra_libs}
|
|
|
|
|
|
|
|
LINK_COMPONENTS
|
2020-02-22 00:13:05 +08:00
|
|
|
Option
|
2018-08-17 01:59:38 +08:00
|
|
|
Support
|
|
|
|
)
|
[CMake] Revised RPATH handling
Summary:
If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling.
* In the build-tree, tools use the absolute path to the framework's actual output location.
* In the install-tree, tools get a list of RPATHs to look for the framework when deployed.
`LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree.
If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree).
If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree.
For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks".
Reviewers: xiaobai, JDevlieghere, aprantl, clayborg
Reviewed By: JDevlieghere
Subscribers: ki.stfu, mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D55330
llvm-svn: 350392
2019-01-04 20:46:57 +08:00
|
|
|
|
|
|
|
if(LLDB_BUILD_FRAMEWORK)
|
2019-05-29 19:26:06 +08:00
|
|
|
# In the build-tree, we know the exact path to the framework directory.
|
|
|
|
# The installed framework can be in different locations.
|
|
|
|
lldb_setup_rpaths(lldb-vscode
|
|
|
|
BUILD_RPATH
|
2019-10-31 01:33:05 +08:00
|
|
|
"${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}"
|
2019-05-29 19:26:06 +08:00
|
|
|
INSTALL_RPATH
|
|
|
|
"@loader_path/../../../SharedFrameworks"
|
|
|
|
"@loader_path/../../System/Library/PrivateFrameworks"
|
|
|
|
"@loader_path/../../Library/PrivateFrameworks"
|
|
|
|
)
|
[CMake] Revised RPATH handling
Summary:
If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling.
* In the build-tree, tools use the absolute path to the framework's actual output location.
* In the install-tree, tools get a list of RPATHs to look for the framework when deployed.
`LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree.
If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree).
If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree.
For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks".
Reviewers: xiaobai, JDevlieghere, aprantl, clayborg
Reviewed By: JDevlieghere
Subscribers: ki.stfu, mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D55330
llvm-svn: 350392
2019-01-04 20:46:57 +08:00
|
|
|
endif()
|