diff options
Diffstat (limited to 'src/windeployqt/main.cpp')
-rw-r--r-- | src/windeployqt/main.cpp | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp index 99d1e152a..71b6e1258 100644 --- a/src/windeployqt/main.cpp +++ b/src/windeployqt/main.cpp @@ -204,18 +204,17 @@ static Platform platformFromMkSpec(const QString &xSpec) { if (xSpec == QLatin1String("linux-g++")) return Unix; - if (xSpec.startsWith(QLatin1String("win32-"))) - return xSpec.contains(QLatin1String("g++")) ? WindowsDesktopMinGW : WindowsDesktop; + if (xSpec.startsWith(QLatin1String("win32-"))) { + if (xSpec.contains(QLatin1String("clang-g++"))) + return WindowsDesktopClangMinGW; + if (xSpec.contains(QLatin1String("clang-msvc++"))) + return WindowsDesktopClangMsvc; + return xSpec.contains(QLatin1String("g++")) ? WindowsDesktopMinGW : WindowsDesktopMsvc; + } if (xSpec.startsWith(QLatin1String("winrt-x"))) - return WinRtIntel; + return WinRtIntelMsvc; if (xSpec.startsWith(QLatin1String("winrt-arm"))) - return WinRtArm; - if (xSpec.startsWith(QLatin1String("wince"))) { - if (xSpec.contains(QLatin1String("-x86-"))) - return WinCEIntel; - if (xSpec.contains(QLatin1String("-arm"))) - return WinCEArm; - } + return WinRtArmMsvc; return UnknownPlatform; } @@ -267,7 +266,7 @@ struct Options { unsigned disabledPlugins = 0; AngleDetection angleDetection = AngleDetectionAuto; bool softwareRasterizer = true; - Platform platform = WindowsDesktop; + Platform platform = WindowsDesktopMsvc; quint64 additionalLibraries = 0; quint64 disabledLibraries = 0; unsigned updateFileFlags = 0; @@ -285,9 +284,7 @@ struct Options { bool dryRun = false; bool patchQt = true; - inline bool isWinRt() const { - return platform == WinRtArm || platform == WinRtIntel; - } + inline bool isWinRt() const { return platform.testFlag(WinRt); } }; // Return binary from folder @@ -503,8 +500,8 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse else if (parser->isSet(noCompilerRunTimeOption)) options->compilerRunTime = false; - if (options->compilerRunTime && options->platform != WindowsDesktopMinGW && options->platform != WindowsDesktop) { - *errorMessage = QStringLiteral("Deployment of the compiler runtime is implemented for Desktop only."); + if (options->compilerRunTime && options->platform != WindowsDesktopMinGW && options->platform != WindowsDesktopMsvc) { + *errorMessage = QStringLiteral("Deployment of the compiler runtime is implemented for Desktop MSVC/g++ only."); return CommandLineParseError; } @@ -526,7 +523,7 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse } if (parser->isSet(deployPdbOption)) { - if ((options->platform & WindowsBased) && !(options->platform & MinGW)) + if (options->platform.testFlag(WindowsBased) && !options->platform.testFlag(MinGW)) options->deployPdb = true; else std::wcerr << "Warning: --" << deployPdbOption.names().first() << " is not supported on this platform.\n"; @@ -919,14 +916,12 @@ QStringList findQtPlugins(quint64 *usedQtModules, quint64 disabledQtModules, const bool isPlatformPlugin = subDirName == QLatin1String("platforms"); if (isPlatformPlugin) { switch (platform) { - case WindowsDesktop: + case WindowsDesktopMsvc: case WindowsDesktopMinGW: - case WinCEIntel: - case WinCEArm: filter = QStringLiteral("qwindows"); break; - case WinRtIntel: - case WinRtArm: + case WinRtIntelMsvc: + case WinRtArmMsvc: filter = QStringLiteral("qwinrt"); break; case Unix: @@ -1064,7 +1059,7 @@ static QString libraryPath(const QString &libraryLocation, const char *name, result += qtLibInfix; if (debug && platformHasDebugSuffix(platform)) result += QLatin1Char('d'); - } else if (platform & UnixBased) { + } else if (platform.testFlag(UnixBased)) { result += QStringLiteral("lib"); result += QLatin1String(name); result += qtLibInfix; @@ -1137,7 +1132,7 @@ static QStringList compilerRunTimeLibs(Platform platform, bool isDebug, unsigned } break; #ifdef Q_OS_WIN - case WindowsDesktop: { // MSVC/Desktop: Add redistributable packages. + case WindowsDesktopMsvc: { // MSVC/Desktop: Add redistributable packages. QString vcRedistDirName = vcRedistDir(); if (vcRedistDirName.isEmpty()) break; @@ -1285,7 +1280,7 @@ static DeployResult deploy(const Options &options, // Some Windows-specific checks: Qt5Core depends on ICU when configured with "-icu". Other than // that, Qt5WebKit has a hard dependency on ICU. - if (options.platform & WindowsBased) { + if (options.platform.testFlag(WindowsBased)) { const QStringList qtLibs = dependentQtLibs.filter(QStringLiteral("Qt5Core"), Qt::CaseInsensitive) + dependentQtLibs.filter(QStringLiteral("Qt5WebKit"), Qt::CaseInsensitive); for (const QString &qtLib : qtLibs) { @@ -1405,8 +1400,7 @@ static DeployResult deploy(const Options &options, } // Check for ANGLE on the Qt5Gui library. - if ((options.platform & WindowsBased) && options.platform != WinCEIntel - && options.platform != WinCEArm && !qtGuiLibrary.isEmpty()) { + if (options.platform.testFlag(WindowsBased) && !qtGuiLibrary.isEmpty()) { QString libGlesName = QStringLiteral("libGLESV2"); if (isDebug && platformHasDebugSuffix(options.platform)) libGlesName += QLatin1Char('d'); @@ -1454,7 +1448,7 @@ static DeployResult deploy(const Options &options, // We need to copy ucrtbased.dll on WinRT as this library is not part of // the c runtime package. VS 2015 does the same when deploying to a device // or creating an appx. - if (isDebug && options.platform == WinRtArm + if (isDebug && options.platform == WinRtArmMsvc && qmakeVariables.value(QStringLiteral("QMAKE_XSPEC")).endsWith(QLatin1String("msvc2015"))) { const QString extensionPath = QString::fromLocal8Bit(qgetenv("ExtensionSdkDir")); const QString ucrtVersion = QString::fromLocal8Bit(qgetenv("UCRTVersion")); @@ -1671,7 +1665,7 @@ int main(int argc, char **argv) const QMap<QString, QString> qmakeVariables = queryQMakeAll(&errorMessage); const QString xSpec = qmakeVariables.value(QStringLiteral("QMAKE_XSPEC")); options.platform = platformFromMkSpec(xSpec); - if (options.platform == WindowsDesktopMinGW || options.platform == WindowsDesktop) + if (options.platform == WindowsDesktopMinGW || options.platform == WindowsDesktopMsvc) options.compilerRunTime = true; { // Command line |