diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-06 17:46:29 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-07 12:53:37 +0200 |
commit | c2a2522089942f8a50237c9dac8cbd9b713d1fb5 (patch) | |
tree | f91e9f474b64f9473bccf0b0308bfac6c9d1ceb2 /src | |
parent | fc038ef44561b6fa60adf40ada84d9337e76808c (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.
Pick-to: 6.2
Change-Id: Ibcd818df1897f603ac194092b28d4bd4d1d6c6ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-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 9665600f94..4e435afdab 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -384,7 +384,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" @@ -1373,4 +1372,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() |