diff options
author | Thomas Miller <thomaslmiller91@gmail.com> | 2018-11-08 14:23:09 -0800 |
---|---|---|
committer | Thomas Miller <thomaslmiller91@gmail.com> | 2018-12-07 20:18:45 +0000 |
commit | bb35a2d244accde7908ddaaa17571b971eb564f0 (patch) | |
tree | d99c5d130482e5d9a5f61f82470eb2c4c00ce8c4 /src/shared/winutils/utils.cpp | |
parent | c52ac7fa312ffbe5d9dd9d388395061d5d2ea81e (diff) |
Enable Windeployqt to package arm64 desktop apps
Change-Id: I8ef5ca54488e3e5cd89bd5a6e7be4958c74fe60d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/shared/winutils/utils.cpp')
-rw-r--r-- | src/shared/winutils/utils.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/shared/winutils/utils.cpp b/src/shared/winutils/utils.cpp index cdf017715..195d8efd5 100644 --- a/src/shared/winutils/utils.cpp +++ b/src/shared/winutils/utils.cpp @@ -840,7 +840,7 @@ inline void determineDebugAndDependentLibs(const ImageNtHeader *nth, const void // and debug flags. bool readPeExecutable(const QString &peExecutableFileName, QString *errorMessage, QStringList *dependentLibrariesIn, unsigned *wordSizeIn, - bool *isDebugIn, bool isMinGW) + bool *isDebugIn, bool isMinGW, unsigned short *machineArchIn) { bool result = false; HANDLE hFile = NULL; @@ -890,6 +890,9 @@ bool readPeExecutable(const QString &peExecutableFileName, QString *errorMessage fileMemory, isMinGW, dependentLibrariesIn, isDebugIn, errorMessage); } + if (machineArchIn) + *machineArchIn = ntHeaders->FileHeader.Machine; + result = true; if (optVerboseLevel > 1) { std::wcout << __FUNCTION__ << ": " << QDir::toNativeSeparators(peExecutableFileName) @@ -970,7 +973,7 @@ QString findD3dCompiler(Platform platform, const QString &qtBinDir, unsigned wor #else // Q_OS_WIN bool readPeExecutable(const QString &, QString *errorMessage, - QStringList *, unsigned *, bool *, bool) + QStringList *, unsigned *, bool *, bool, unsigned short *) { *errorMessage = QStringLiteral("Not implemented."); return false; @@ -1032,4 +1035,23 @@ bool patchQtCore(const QString &path, QString *errorMessage) return true; } +#ifdef Q_OS_WIN +QString getArchString(unsigned short machineArch) +{ + switch (machineArch) { + case IMAGE_FILE_MACHINE_I386: + return QStringLiteral("x86"); + case IMAGE_FILE_MACHINE_ARM: + return QStringLiteral("arm"); + case IMAGE_FILE_MACHINE_AMD64: + return QStringLiteral("x64"); + case IMAGE_FILE_MACHINE_ARM64: + return QStringLiteral("arm64"); + default: + break; + } + return QString(); +} +#endif // Q_OS_WIN + QT_END_NAMESPACE |