From c1b8f4aee60fd049c5508ed1910a66f7c093e64a Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 25 Apr 2024 10:47:17 +0200 Subject: [PATCH] windeployqt: Deploy target dlls for directx and vc runtime When deploying for a cross compiled target we should deploy the target versions of directx and compiler runtime dlls. Thus a new platform was added to utils to be able to reflect this distinction. Fixes: QTBUG-124719 Change-Id: I4dd797804fa871d76d56f8775b188d4306b51e5a Reviewed-by: Joerg Bornemann (cherry picked from commit ed191b6afa36aaf47478856fc44b9ebc300ff808) Reviewed-by: Qt Cherry-pick Bot --- src/tools/windeployqt/main.cpp | 15 ++++++++++----- src/tools/windeployqt/utils.h | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index a5c05b91172..b884f272a90 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -137,7 +137,10 @@ static Platform platformFromMkSpec(const QString &xSpec) return WindowsDesktopClangMinGW; if (xSpec.contains("clang-msvc++"_L1)) return WindowsDesktopClangMsvc; - return xSpec.contains("g++"_L1) ? WindowsDesktopMinGW : WindowsDesktopMsvc; + if (xSpec.contains("arm"_L1)) + return WindowsDesktopMsvcArm; + + return xSpec.contains("g++"_L1) ? WindowsDesktopMinGW : WindowsDesktopMsvcIntel; } return UnknownPlatform; } @@ -183,7 +186,7 @@ struct Options { bool softwareRasterizer = true; bool ffmpeg = true; PluginSelections pluginSelections; - Platform platform = WindowsDesktopMsvc; + Platform platform = WindowsDesktopMsvcIntel; ModuleBitset additionalLibraries; ModuleBitset disabledLibraries; unsigned updateFileFlags = 0; @@ -552,13 +555,14 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse options->quickImports = !parser->isSet(noQuickImportOption); // default to deployment of compiler runtime for windows desktop configurations - if (options->platform == WindowsDesktopMinGW || options->platform == WindowsDesktopMsvc + if (options->platform == WindowsDesktopMinGW || options->platform.testFlags(WindowsDesktopMsvc) || parser->isSet(compilerRunTimeOption)) options->compilerRunTime = true; if (parser->isSet(noCompilerRunTimeOption)) options->compilerRunTime = false; - if (options->compilerRunTime && options->platform != WindowsDesktopMinGW && options->platform != WindowsDesktopMsvc) { + if (options->compilerRunTime && options->platform != WindowsDesktopMinGW + && !options->platform.testFlags(WindowsDesktopMsvc)) { *errorMessage = QStringLiteral("Deployment of the compiler runtime is implemented for Desktop MSVC/g++ only."); return CommandLineParseError; } @@ -1305,7 +1309,8 @@ static QStringList compilerRunTimeLibs(const QString &qtBinDir, Platform platfor break; } #ifdef Q_OS_WIN - case WindowsDesktopMsvc: { // MSVC/Desktop: Add redistributable packages. + case WindowsDesktopMsvcIntel: + case WindowsDesktopMsvcArm: { // MSVC/Desktop: Add redistributable packages. QString vcRedistDirName = vcRedistDir(); if (vcRedistDirName.isEmpty()) break; diff --git a/src/tools/windeployqt/utils.h b/src/tools/windeployqt/utils.h index 2c7cd79bf01..fb3ba0b40b1 100644 --- a/src/tools/windeployqt/utils.h +++ b/src/tools/windeployqt/utils.h @@ -29,7 +29,9 @@ enum PlatformFlag { ClangMsvc = 0x00400, ClangMinGW = 0x00800, // Platforms - WindowsDesktopMsvc = WindowsBased + IntelBased + Msvc, + WindowsDesktopMsvc = WindowsBased + Msvc, + WindowsDesktopMsvcIntel = WindowsDesktopMsvc + IntelBased, + WindowsDesktopMsvcArm = WindowsDesktopMsvc + ArmBased, WindowsDesktopMinGW = WindowsBased + IntelBased + MinGW, WindowsDesktopClangMsvc = WindowsBased + IntelBased + ClangMsvc, WindowsDesktopClangMinGW = WindowsBased + IntelBased + ClangMinGW,