[Lldb-commits] [PATCH] D72286: installation: Accept separate install prefix for LLDB.framework
Vedant Kumar via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 6 09:47:11 PST 2020
vsk created this revision.
vsk added reviewers: davide, teemperor, friss.
Herald added a subscriber: mgorny.
To support multi-arch (fat) builds of swift-lldb, the build script sets
up separate per-arch install directories, runs each arch-specific build,
and then lipo's together the contents.
Split up LLDB_FRAMEWORK_INSTALL_DIR into a prefix (this can be supplied
by the build script) and the final install location. The concatenated
path is called LLDB_FRAMEWORK_INSTALL_PATH.
The idea is to have the build script supply the prefix used for the lipo step,
and for lldb's cmake caches to specify the right install dir for a given target.
https://reviews.llvm.org/D72286
Files:
lldb/CMakeLists.txt
lldb/cmake/modules/AddLLDB.cmake
lldb/cmake/modules/LLDBConfig.cmake
lldb/cmake/modules/LLDBFramework.cmake
lldb/source/API/CMakeLists.txt
Index: lldb/source/API/CMakeLists.txt
===================================================================
--- lldb/source/API/CMakeLists.txt
+++ lldb/source/API/CMakeLists.txt
@@ -15,7 +15,7 @@
endif()
if(LLDB_BUILD_FRAMEWORK)
- set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR})
+ set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_PATH})
set(option_framework FRAMEWORK)
endif()
Index: lldb/cmake/modules/LLDBFramework.cmake
===================================================================
--- lldb/cmake/modules/LLDBFramework.cmake
+++ lldb/cmake/modules/LLDBFramework.cmake
@@ -1,5 +1,5 @@
message(STATUS "LLDB.framework: build path is '${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}'")
-message(STATUS "LLDB.framework: install path is '${LLDB_FRAMEWORK_INSTALL_DIR}'")
+message(STATUS "LLDB.framework: install path is '${LLDB_FRAMEWORK_INSTALL_PATH}'")
message(STATUS "LLDB.framework: resources subdirectory is 'Versions/${LLDB_FRAMEWORK_VERSION}/Resources'")
# Configure liblldb as a framework bundle
@@ -27,7 +27,7 @@
LIBRARY_DIR ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}
)
-lldb_add_post_install_steps_darwin(liblldb ${LLDB_FRAMEWORK_INSTALL_DIR})
+lldb_add_post_install_steps_darwin(liblldb ${LLDB_FRAMEWORK_INSTALL_PATH})
# Affects the layout of the framework bundle (default is macOS layout).
if(IOS)
Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -90,7 +90,9 @@
set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)")
set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework")
+ set(LLDB_FRAMEWORK_INSTALL_PREFIX "" CACHE STRING "Prefix for the LLDB.framework install directory")
set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework")
+ set(LLDB_FRAMEWORK_INSTALL_PATH "${LLDB_FRAMEWORK_INSTALL_PREFIX}${LLDB_FRAMEWORK_INSTALL_DIR}")
get_filename_component(LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE
BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR})
Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -218,7 +218,7 @@
set(subdir LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources)
add_lldb_executable(${name}
GENERATE_INSTALL
- INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR}/${subdir}
+ INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_PATH}/${subdir}
${ARG_UNPARSED_ARGUMENTS}
)
lldb_add_to_buildtree_lldb_framework(${name} ${subdir})
Index: lldb/CMakeLists.txt
===================================================================
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -221,7 +221,7 @@
# Install the LLDB python module
if(LLDB_BUILD_FRAMEWORK)
- set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Resources/Python)
+ set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_PATH}/LLDB.framework/Resources/Python)
else()
set(LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_RELATIVE_PATH})
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72286.236398.patch
Type: text/x-patch
Size: 3282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200106/5288babb/attachment.bin>
More information about the lldb-commits
mailing list