2018-11-28 05:00:32 +08:00
|
|
|
set(LLVM_TARGET_DEFINITIONS Options.td)
|
|
|
|
tablegen(LLVM Options.inc -gen-opt-parser-defs)
|
|
|
|
add_public_tablegen_target(LLDBOptionsTableGen)
|
|
|
|
|
2019-05-18 03:19:34 +08:00
|
|
|
if(APPLE)
|
2019-11-16 01:46:27 +08:00
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lldb-Info.plist.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist
|
|
|
|
)
|
2019-05-18 03:19:34 +08:00
|
|
|
# Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available)
|
2019-11-16 01:46:27 +08:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-Info.plist")
|
2019-05-18 03:19:34 +08:00
|
|
|
endif()
|
|
|
|
|
2016-12-16 06:01:17 +08:00
|
|
|
add_lldb_tool(lldb
|
2013-09-25 18:37:32 +08:00
|
|
|
Driver.cpp
|
2013-10-15 23:46:40 +08:00
|
|
|
Platform.cpp
|
2017-02-01 04:43:05 +08:00
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
liblldb
|
|
|
|
|
|
|
|
LINK_COMPONENTS
|
2018-11-28 05:00:32 +08:00
|
|
|
Option
|
2017-02-01 04:43:05 +08:00
|
|
|
Support
|
2013-09-25 18:37:32 +08:00
|
|
|
)
|
|
|
|
|
2014-03-03 23:50:36 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
2015-02-25 06:17:57 +08:00
|
|
|
add_definitions( -DIMPORT_LIBLLDB )
|
2014-03-03 23:50:36 +08:00
|
|
|
endif()
|
|
|
|
|
2018-11-28 05:00:32 +08:00
|
|
|
add_dependencies(lldb
|
|
|
|
LLDBOptionsTableGen
|
|
|
|
${tablegen_deps}
|
|
|
|
)
|
[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
|
|
|
|
2019-05-28 17:29:05 +08:00
|
|
|
set_target_properties(LLDBOptionsTableGen PROPERTIES FOLDER "lldb misc")
|
|
|
|
|
[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
|
|
|
|
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()
|