Skip to content

Commit

Permalink
windeployqt: MSVC: Add support for ARM64 hosts
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
owolff committed May 14, 2024
1 parent 3ca9877 commit 8198480
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/tools/windeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8198480

Please sign in to comment.