hhb created this revision.
hhb added a reviewer: labath.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.
This avoids config time dependencies on liblldb. And enables other
refactoring.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D69630
Files:
lldb/cmake/modules/AddLLDB.cmake
lldb/cmake/modules/LLDBConfig.cmake
lldb/cmake/modules/LLDBFramework.cmake
lldb/test/API/CMakeLists.txt
lldb/tools/debugserver/source/CMakeLists.txt
lldb/tools/driver/CMakeLists.txt
lldb/tools/lldb-vscode/CMakeLists.txt
Index: lldb/tools/lldb-vscode/CMakeLists.txt
===================================================================
--- lldb/tools/lldb-vscode/CMakeLists.txt
+++ lldb/tools/lldb-vscode/CMakeLists.txt
@@ -33,10 +33,9 @@
if(LLDB_BUILD_FRAMEWORK)
# In the build-tree, we know the exact path to the framework directory.
# The installed framework can be in different locations.
- get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
lldb_setup_rpaths(lldb-vscode
BUILD_RPATH
- "${framework_build_dir}"
+ "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}"
INSTALL_RPATH
"@loader_path/../../../SharedFrameworks"
"@loader_path/../../System/Library/PrivateFrameworks"
Index: lldb/tools/driver/CMakeLists.txt
===================================================================
--- lldb/tools/driver/CMakeLists.txt
+++ lldb/tools/driver/CMakeLists.txt
@@ -33,10 +33,9 @@
if(LLDB_BUILD_FRAMEWORK)
# In the build-tree, we know the exact path to the framework directory.
# The installed framework can be in different locations.
- get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
lldb_setup_rpaths(lldb
BUILD_RPATH
- "${framework_build_dir}"
+ "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}"
INSTALL_RPATH
"@loader_path/../../../SharedFrameworks"
"@loader_path/../../System/Library/PrivateFrameworks"
Index: lldb/tools/debugserver/source/CMakeLists.txt
===================================================================
--- lldb/tools/debugserver/source/CMakeLists.txt
+++ lldb/tools/debugserver/source/CMakeLists.txt
@@ -219,8 +219,7 @@
set(pass_entitlements --entitlements ${entitlements})
endif()
- get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
- set(copy_location ${framework_build_dir}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/debugserver)
+ set(copy_location ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/debugserver)
add_custom_command(TARGET debugserver POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
Index: lldb/test/API/CMakeLists.txt
===================================================================
--- lldb/test/API/CMakeLists.txt
+++ lldb/test/API/CMakeLists.txt
@@ -107,8 +107,7 @@
if(CMAKE_HOST_APPLE)
if(LLDB_BUILD_FRAMEWORK)
- get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
- list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework)
+ list(APPEND LLDB_TEST_COMMON_ARGS --framework ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework)
endif()
# Use the same identity for testing
Index: lldb/cmake/modules/LLDBFramework.cmake
===================================================================
--- lldb/cmake/modules/LLDBFramework.cmake
+++ lldb/cmake/modules/LLDBFramework.cmake
@@ -1,10 +1,4 @@
-# Path relative to the root binary directory
-get_filename_component(
- framework_target_dir ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE
- BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}
-)
-
-message(STATUS "LLDB.framework: build path is '${framework_target_dir}'")
+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: resources subdirectory is 'Versions/${LLDB_FRAMEWORK_VERSION}/Resources'")
@@ -15,7 +9,7 @@
OUTPUT_NAME LLDB
VERSION ${LLDB_VERSION}
- LIBRARY_OUTPUT_DIRECTORY ${framework_target_dir}
+ LIBRARY_OUTPUT_DIRECTORY ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}
# Compatibility version
SOVERSION "1.0.0"
@@ -29,8 +23,8 @@
# Used in llvm_add_library() to set default output directories for multi-config
# generators. Overwrite to account for special framework output directory.
set_output_directory(liblldb
- BINARY_DIR ${framework_target_dir}
- LIBRARY_DIR ${framework_target_dir}
+ BINARY_DIR ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}
+ LIBRARY_DIR ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}
)
lldb_add_post_install_steps_darwin(liblldb ${LLDB_FRAMEWORK_INSTALL_DIR})
@@ -51,7 +45,7 @@
add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
Versions/Current/Headers
- ${framework_target_dir}/LLDB.framework/Headers
+ ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Headers
COMMENT "LLDB.framework: create Headers symlink"
)
Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -67,6 +67,9 @@
set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework")
set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework")
+ get_filename_component(LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE
+ BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR})
+
# Essentially, emit the framework's dSYM outside of the framework directory.
set(LLDB_DEBUGINFO_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin CACHE STRING
"Directory to emit dSYM files stripped from executables and libraries (Darwin Only)")
Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -227,8 +227,7 @@
function(lldb_add_to_buildtree_lldb_framework name subdir)
# Destination for the copy in the build-tree. While the framework target may
# not exist yet, it will exist when the generator expression gets expanded.
- get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
- set(copy_dest "${framework_build_dir}/${subdir}/$<TARGET_FILE_NAME:${name}>")
+ set(copy_dest "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/${subdir}/$<TARGET_FILE_NAME:${name}>")
# Copy into the given subdirectory for testing.
add_custom_command(TARGET ${name} POST_BUILD
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits