windeployqt: Fixed --debug and --release together with --qmldir
authorOliver Wolff <oliver.wolff@digia.com>
Thu, 27 Feb 2014 10:29:12 +0000 (11:29 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Feb 2014 11:20:33 +0000 (12:20 +0100)
If --debug or --release is used, findDependentQtLibraries should not
change the isDebug value, so another variable was introduced.
"detectedDebug" gives information about the detected debug state of
the executable/library but this value might be ignored if --debug
or --release was used.

Change-Id: I2c6d4188179f30e17d054a6821e96071a6296207
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/windeployqt/main.cpp

index c71822c..e97ee9b 100644 (file)
@@ -750,14 +750,14 @@ static DeployResult deploy(const Options &options,
         std::wcout << "Qt binaries in " << QDir::toNativeSeparators(qtBinDir) << '\n';
 
     QStringList dependentQtLibs;
-    bool isDebug;
+    bool detectedDebug;
     unsigned wordSize;
     int directDependencyCount;
-    if (!findDependentQtLibraries(libraryLocation, options.binary, options.platform, errorMessage, &dependentQtLibs, &wordSize, &isDebug, &directDependencyCount))
+    if (!findDependentQtLibraries(libraryLocation, options.binary, options.platform, errorMessage, &dependentQtLibs, &wordSize,
+                                  &detectedDebug, &directDependencyCount))
         return result;
 
-    if (options.debugDetection != Options::DebugDetectionAuto)
-        isDebug = options.debugDetection == Options::DebugDetectionForceDebug;
+    const bool isDebug = options.debugDetection == Options::DebugDetectionAuto ? detectedDebug: options.debugDetection == Options::DebugDetectionForceDebug;
 
     // Determine application type, check Quick2 is used by looking at the
     // direct dependencies (do not be fooled by QtWebKit depending on it).
@@ -828,7 +828,7 @@ static DeployResult deploy(const Options &options,
             qmlScanResult.append(scanResult);
             // Additional dependencies of QML plugins.
             foreach (const QString &plugin, qmlScanResult.plugins) {
-                if (!findDependentQtLibraries(libraryLocation, plugin, options.platform, errorMessage, &dependentQtLibs, &wordSize, &isDebug))
+                if (!findDependentQtLibraries(libraryLocation, plugin, options.platform, errorMessage, &dependentQtLibs, &wordSize, &detectedDebug))
                     return result;
             }
             if (optVerboseLevel >= 1) {