diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -93,10 +93,9 @@ if (NOT LLDB_DISABLE_PYTHON) get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) - get_target_property(liblldb_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) if(LLDB_BUILD_FRAMEWORK) - set(lldb_python_build_path "${liblldb_build_dir}/LLDB.framework/Resources/Python/lldb") + set(lldb_python_build_path "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") else() set(lldb_python_build_path "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") endif() @@ -188,7 +187,7 @@ endfunction() if(LLDB_BUILD_FRAMEWORK) - set(LIBLLDB_SYMLINK_DEST "${liblldb_build_dir}/LLDB.framework/LLDB") + set(LIBLLDB_SYMLINK_DEST "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/LLDB") else() set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}") endif() diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/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}/$") + set(copy_dest "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/${subdir}/$") # Copy into the given subdirectory for testing. add_custom_command(TARGET ${name} POST_BUILD diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/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)") diff --git a/lldb/cmake/modules/LLDBFramework.cmake b/lldb/cmake/modules/LLDBFramework.cmake --- a/lldb/cmake/modules/LLDBFramework.cmake +++ b/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" ) diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt --- a/lldb/test/API/CMakeLists.txt +++ b/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 diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt --- a/lldb/tools/debugserver/source/CMakeLists.txt +++ b/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 diff --git a/lldb/tools/driver/CMakeLists.txt b/lldb/tools/driver/CMakeLists.txt --- a/lldb/tools/driver/CMakeLists.txt +++ b/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" diff --git a/lldb/tools/lldb-vscode/CMakeLists.txt b/lldb/tools/lldb-vscode/CMakeLists.txt --- a/lldb/tools/lldb-vscode/CMakeLists.txt +++ b/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"