2019-05-18 03:19:41 +08:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
|
|
|
|
|
|
|
|
set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "")
|
|
|
|
set(LLDB_NO_INSTALL_DEFAULT_RPATH ON CACHE BOOL "")
|
2020-10-21 09:15:45 +08:00
|
|
|
set(LLDB_SKIP_STRIP ON CACHE BOOL "")
|
2019-07-10 23:59:50 +08:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "")
|
2019-05-18 03:19:41 +08:00
|
|
|
|
2019-07-10 23:59:50 +08:00
|
|
|
# Default install location on the enduser machine. On the build machine, use the
|
|
|
|
# DESTDIR environment variable in order to relocate the whole installation, e.g.:
|
|
|
|
# `DESTDIR=/tmp ninja install-distribution`
|
2019-05-18 03:19:41 +08:00
|
|
|
set(CMAKE_INSTALL_PREFIX /Applications/Xcode.app/Contents/Developer/usr CACHE STRING "")
|
|
|
|
|
2019-07-10 23:59:50 +08:00
|
|
|
# Install location for LLDB.framework on the enduser machine.
|
|
|
|
# DESTDIR will be an extra prefix.
|
2019-05-18 03:19:41 +08:00
|
|
|
set(LLDB_FRAMEWORK_INSTALL_DIR /Applications/Xcode.app/Contents/SharedFrameworks CACHE STRING "")
|
|
|
|
|
2019-07-10 23:59:50 +08:00
|
|
|
# Install location for externalized debug-info on the build machine.
|
|
|
|
# DESTDIR will be an extra prefix.
|
[CMake] `install-distribution` for LLDB on Darwin
Summary:
There's a number of requirements for installing LLDB on macOS that are untypical for LLVM projects: use special install-prefix for LLDB.framework, ship headers and tools as framework resources, patch RPATHs, externalize debug-info to dSYM's and strip binaries with `-ST`. For some of it we could use `llvm_externalize_debuginfo()` in the past and just add special cases. However, this complicates the code for all projects and comes with the major drawback, that it adds all these actions at build-time, i.e. dSYM creation and stripping take a lot of time and don't make sense at build-time.
LLVM's distribution mechanism (https://llvm.org/docs/BuildingADistribution.html) appears to be the natural candidate to install LLDB. Based on D64399 (enable in standalone builds), this patch integrates framework installation with the distribution mechanism and adds custom stripping flags and dSYM creation at install-time. Unlike the abandoned D61952, it leaves build-tree binaries untouched, so there's no side-effects on testing. Potential install-order issues must be handled externally.
Please let me know what you think, while I run a few more tests and add remarks+documentation.
Reviewers: xiaobai, compnerd, JDevlieghere, davide, labath, mgorny
Reviewed By: xiaobai, JDevlieghere
Subscribers: lldb-commits, #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64408
llvm-svn: 365617
2019-07-10 19:09:29 +08:00
|
|
|
set(LLDB_DEBUGINFO_INSTALL_PREFIX /debuginfo CACHE STRING "")
|
|
|
|
|
2019-07-10 19:09:11 +08:00
|
|
|
set(LLVM_DISTRIBUTION_COMPONENTS
|
|
|
|
lldb
|
|
|
|
liblldb
|
|
|
|
lldb-argdumper
|
|
|
|
darwin-debug
|
|
|
|
debugserver
|
|
|
|
CACHE STRING "")
|