summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2024-04-25 12:55:55 +0200
committerOliver Wolff <oliver.wolff@qt.io>2024-05-14 19:12:56 +0200
commit81984807b30b1865a98fbd928a29d5ab6d8f5375 (patch)
tree26424ef89e338dab6cf205b4bfb07ff6c11296f0
parent3ca9877f8cae41e1b1cb3c72d4a7872d97fb8254 (diff)
windeployqt: MSVC: Add support for ARM64 hosts
Windeployqt deployed all the non Qt libraries in their x64 versions as it was not aware of the host it was running on. This check needs to be done before any deployment happens. Current support is limited for MSVC. mingw/clang might be done in followup commits. Pick-to: 6.7 Change-Id: I70fd6ad66c9cacfc6ff5b109f214a142b8b6d5f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/tools/windeployqt/main.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp
index 084345a4d8..dca9132e15 100644
--- a/src/tools/windeployqt/main.cpp
+++ b/src/tools/windeployqt/main.cpp
@@ -139,8 +139,10 @@ static Platform platformFromMkSpec(const QString &xSpec)
return WindowsDesktopClangMsvc;
if (xSpec.contains("arm"_L1))
return WindowsDesktopMsvcArm;
+ if (xSpec.contains("G++"_L1))
+ return WindowsDesktopMinGW;
- return xSpec.contains("g++"_L1) ? WindowsDesktopMinGW : WindowsDesktopMsvcIntel;
+ return WindowsDesktopMsvc;
}
return UnknownPlatform;
}
@@ -1928,6 +1930,24 @@ int main(int argc, char **argv)
}
options.platform = platformFromMkSpec(xSpec);
+ // We are on MSVC and not crosscompiling. We need the host arch
+ if (options.platform == WindowsDesktopMsvc) {
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ switch (si.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ case PROCESSOR_ARCHITECTURE_IA64:
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ options.platform |= IntelBased;
+ break;
+ case PROCESSOR_ARCHITECTURE_ARM:
+ case PROCESSOR_ARCHITECTURE_ARM64:
+ options.platform |= ArmBased;
+ break;
+ default:
+ options.platform = UnknownPlatform;
+ }
+ }
if (options.platform == UnknownPlatform) {
std::wcerr << "Unsupported platform " << xSpec << '\n';
return 1;