diff --git a/bin/qt-cmake-private-install.cmake.in b/bin/qt-cmake-private-install.cmake.in index 19dddd4fcb3..71a94e190d4 100644 --- a/bin/qt-cmake-private-install.cmake.in +++ b/bin/qt-cmake-private-install.cmake.in @@ -5,13 +5,18 @@ # https://gitlab.kitware.com/cmake/cmake/-/issues/20713 # https://gitlab.kitware.com/cmake/cmake/-/issues/21475 set(configs "@__qt_configured_configs@") +set(should_skip_strip "@__qt_skip_strip_installed_artifacts@") + if(NOT QT_BUILD_DIR) message(FATAL_ERROR "No QT_BUILD_DIR value provided to qt-cmake-private-install.") endif() -unset(strip_arg) -if ("x@MSVC@" STREQUAL "x") - set(strip_arg --strip) + +if(should_skip_strip) + unset(strip_arg) +else() + set(strip_arg --strip) endif() + foreach(config ${configs}) message(STATUS "Installing configuration: '${config}'") set(args "${CMAKE_COMMAND}" --install ${QT_BUILD_DIR} --config "${config}" ${strip_arg}) diff --git a/cmake/QtWrapperScriptHelpers.cmake b/cmake/QtWrapperScriptHelpers.cmake index e42c3e282fa..b95bf509f76 100644 --- a/cmake/QtWrapperScriptHelpers.cmake +++ b/cmake/QtWrapperScriptHelpers.cmake @@ -203,6 +203,22 @@ function(qt_internal_create_wrapper_scripts) elseif(CMAKE_BUILD_TYPE) set(__qt_configured_configs "${CMAKE_BUILD_TYPE}") endif() + + if( + # Skip stripping pure debug builds so it's easier to debug issues in CI VMs. + (NOT QT_FEATURE_debug_and_release + AND QT_FEATURE_debug + AND NOT QT_FEATURE_separate_debug_info) + + # Skip stripping on MSVC because ${CMAKE_STRIP} might contain a MinGW strip binary + # and the breaks the linker version flag embedded in the binary and causes Qt Creator + # to mis-identify the Kit ABI. + OR MSVC + ) + set(__qt_skip_strip_installed_artifacts TRUE) + else() + set(__qt_skip_strip_installed_artifacts FALSE) + endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in" "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}" @ONLY) qt_install(FILES "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}"