summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/windeployqt/main.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp
index 71b6e1258..bae019150 100644
--- a/src/windeployqt/main.cpp
+++ b/src/windeployqt/main.cpp
@@ -1246,9 +1246,26 @@ static DeployResult deploy(const Options &options,
}
}
- const bool isDebug = options.debugDetection == Options::DebugDetectionAuto ? detectedDebug: options.debugDetection == Options::DebugDetectionForceDebug;
- result.isDebug = isDebug;
- const DebugMatchMode debugMatchMode = isDebug ? MatchDebug : MatchRelease;
+ DebugMatchMode debugMatchMode = MatchDebugOrRelease;
+ result.isDebug = false;
+ switch (options.debugDetection) {
+ case Options::DebugDetectionAuto:
+ // Debug detection is only relevant for Msvc/ClangMsvc which have distinct
+ // runtimes and binaries. For anything else, use MatchDebugOrRelease
+ // since also debug cannot be reliably detect for MinGW.
+ if (options.platform.testFlag(Msvc) || options.platform.testFlag(ClangMsvc)) {
+ result.isDebug = detectedDebug;
+ debugMatchMode = result.isDebug ? MatchDebug : MatchRelease;
+ }
+ break;
+ case Options::DebugDetectionForceDebug:
+ result.isDebug = true;
+ debugMatchMode = MatchDebug;
+ break;
+ case Options::DebugDetectionForceRelease:
+ debugMatchMode = MatchRelease;
+ break;
+ }
// Determine application type, check Quick2 is used by looking at the
// direct dependencies (do not be fooled by QtWebKit depending on it).
@@ -1266,7 +1283,7 @@ static DeployResult deploy(const Options &options,
if (optVerboseLevel) {
std::wcout << QDir::toNativeSeparators(options.binaries.first()) << ' '
- << wordSize << " bit, " << (isDebug ? "debug" : "release")
+ << wordSize << " bit, " << (result.isDebug ? "debug" : "release")
<< " executable";
if (usesQml2)
std::wcout << " [QML]";
@@ -1378,7 +1395,7 @@ static DeployResult deploy(const Options &options,
QString qtGuiLibrary;
for (const auto &qtModule : qtModuleEntries) {
if (result.deployedQtLibraries & qtModule.module) {
- const QString library = libraryPath(libraryLocation, qtModule.libraryName, qtLibInfix, options.platform, isDebug);
+ const QString library = libraryPath(libraryLocation, qtModule.libraryName, qtLibInfix, options.platform, result.isDebug);
deployedQtLibraries.append(library);
if (qtModule.module == QtGuiModule)
qtGuiLibrary = library;
@@ -1402,11 +1419,11 @@ static DeployResult deploy(const Options &options,
// Check for ANGLE on the Qt5Gui library.
if (options.platform.testFlag(WindowsBased) && !qtGuiLibrary.isEmpty()) {
QString libGlesName = QStringLiteral("libGLESV2");
- if (isDebug && platformHasDebugSuffix(options.platform))
+ if (result.isDebug && platformHasDebugSuffix(options.platform))
libGlesName += QLatin1Char('d');
libGlesName += QLatin1String(windowsSharedLibrarySuffix);
QString libCombinedQtAngleName = QStringLiteral("QtANGLE");
- if (isDebug && platformHasDebugSuffix(options.platform))
+ if (result.isDebug && platformHasDebugSuffix(options.platform))
libCombinedQtAngleName += QLatin1Char('d');
libCombinedQtAngleName += QLatin1String(windowsSharedLibrarySuffix);
const QStringList guiLibraries = findDependentLibraries(qtGuiLibrary, options.platform, errorMessage);
@@ -1422,7 +1439,7 @@ static DeployResult deploy(const Options &options,
const QString libGlesFullPath = qtBinDir + slash + libGlesName;
deployedQtLibraries.append(libGlesFullPath);
QString libEglFullPath = qtBinDir + slash + QStringLiteral("libEGL");
- if (isDebug && platformHasDebugSuffix(options.platform))
+ if (result.isDebug && platformHasDebugSuffix(options.platform))
libEglFullPath += QLatin1Char('d');
libEglFullPath += QLatin1String(windowsSharedLibrarySuffix);
deployedQtLibraries.append(libEglFullPath);
@@ -1448,7 +1465,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 == WinRtArmMsvc
+ if (result.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"));
@@ -1478,7 +1495,7 @@ static DeployResult deploy(const Options &options,
options.directory : options.libraryDirectory;
QStringList libraries = deployedQtLibraries;
if (options.compilerRunTime)
- libraries.append(compilerRunTimeLibs(options.platform, isDebug, machineArch));
+ libraries.append(compilerRunTimeLibs(options.platform, result.isDebug, machineArch));
for (const QString &qtLib : qAsConst(libraries)) {
if (!updateLibrary(qtLib, targetPath, options, errorMessage))
return result;
@@ -1486,7 +1503,7 @@ static DeployResult deploy(const Options &options,
if (options.patchQt && !options.dryRun && !options.isWinRt()) {
const QString qt5CoreName = QFileInfo(libraryPath(libraryLocation, "Qt5Core", qtLibInfix,
- options.platform, isDebug)).fileName();
+ options.platform, result.isDebug)).fileName();
#ifndef QT_RELOCATABLE
if (!patchQtCore(targetPath + QLatin1Char('/') + qt5CoreName, errorMessage)) {
std::wcerr << "Warning: " << *errorMessage << '\n';