diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-06 17:46:29 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-07 10:53:55 +0000 |
commit | 6776dc447f9ab1b8c1c6baff3601be78c9b47738 (patch) | |
tree | 8ddd6616932d2f8d51950faef3d0d5da751fa787 | |
parent | 70faf925efb661846b6ef3b10477336a9d139163 (diff) |
CMake: Copy and install lldb QtCore.py script for lldb and Xcode use
The file was not handled during the qmake -> CMake transition.
qmake had a more generic mechanism to allow embedding dSYM scripts per
Qt module, but it wasn't used as far as I know, so the CMake
implementation only limits it to QtCore.
Change-Id: Ibcd818df1897f603ac194092b28d4bd4d1d6c6ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c2a2522089942f8a50237c9dac8cbd9b713d1fb5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/corelib/CMakeLists.txt | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 3e92083e9c..0bcc3b75b5 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -373,7 +373,6 @@ endif() # INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files" # MODULE = "core" # MODULE_CONFIG = "moc" "resources" -# QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py" # QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf" # QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install" # cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in" @@ -1355,4 +1354,29 @@ endif() qt_internal_add_optimize_full_flags() -# special case end +# Copy / install an lldb python script into the QtCore.framework.dSYM bundle which searches +# for the latest installed Qt Creator and loads its lldbbridge.py script. +# When debugging a Qt app, lldb will prompt the developer to explicitly import the shim script. +# It will then enable Qt C++ type pretty printers when using command-line lldb or Xcode +# (e.g. show contents of QString). +if(APPLE AND QT_FEATURE_framework AND QT_FEATURE_separate_debug_info) + qt_internal_module_info(dsym_module_name "Core") + + set(dsym_dir "${dsym_module_name}.framework.dSYM") + set(script_name "${dsym_module_name}.py") + set(dsym_script_dir_suffix "${INSTALL_LIBDIR}/${dsym_dir}/Contents/Resources/Python") + set(dsym_script_build_path "${QT_BUILD_DIR}/${dsym_script_dir_suffix}/${script_name}") + + qt_path_join(dsym_script_install_dir + ${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX} ${dsym_script_dir_suffix}) + + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/debug_script.py" + "${dsym_script_build_path}" + @ONLY + ) + qt_install(FILES + "${dsym_script_build_path}" + DESTINATION "${dsym_script_install_dir}" + ) +endif() |