summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-22 11:36:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-22 13:25:50 +0100
commitef05d0c9f34560647a76615d1fb40a01ba8ad991 (patch)
treecf13c25744af17fc4585e875fd39a3f5ebe7fd1a
parentcf01d7136fb79ee3f8e8522748b08519f0ea528f (diff)
downloadqttools-ef05d0c9f34560647a76615d1fb40a01ba8ad991.tar.gz
windeployqt: Add options to override debug/release detection.
Task-number: QTBUG-36347 Change-Id: I6cad9f7b699a442476698819d5608f572687c39b Reviewed-by: Andrew Knight <andrew.knight@digia.com>
-rw-r--r--src/windeployqt/main.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp
index 546727621..bf31f2d10 100644
--- a/src/windeployqt/main.cpp
+++ b/src/windeployqt/main.cpp
@@ -182,9 +182,15 @@ bool optHelp = false;
int optWebKit2 = 0;
struct Options {
+ enum DebugDetection {
+ DebugDetectionAuto,
+ DebugDetectionForceDebug,
+ DebugDetectionForceRelease
+ };
+
Options() : plugins(true), libraries(true), quickImports(true), translations(true), systemD3dCompiler(true)
, platform(Windows), additionalLibraries(0), disabledLibraries(0)
- , updateFileFlags(0), json(0), list(ListNone) {}
+ , updateFileFlags(0), json(0), list(ListNone), debugDetection(DebugDetectionAuto) {}
bool plugins;
bool libraries;
@@ -201,6 +207,7 @@ struct Options {
QString binary;
JsonOutput *json;
ListOption list;
+ DebugDetection debugDetection;
};
// Return binary from folder
@@ -243,6 +250,13 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
QStringLiteral("path"));
parser->addOption(libDirOption);
+ QCommandLineOption debugOption(QStringLiteral("debug"),
+ QStringLiteral("Assume debug binaries."));
+ parser->addOption(debugOption);
+ QCommandLineOption releaseOption(QStringLiteral("release"),
+ QStringLiteral("Assume release binaries."));
+ parser->addOption(releaseOption);
+
QCommandLineOption forceOption(QStringLiteral("force"),
QStringLiteral("Force updating files."));
parser->addOption(forceOption);
@@ -341,6 +355,16 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
options->translations = !parser->isSet(noTranslationOption);
options->systemD3dCompiler = !parser->isSet(noSystemD3DCompilerOption);
options->quickImports = !parser->isSet(noQuickImportOption);
+
+ const bool forceDebug = parser->isSet(debugOption);
+ const bool forceRelease = parser->isSet(releaseOption);
+ if (forceDebug && forceRelease)
+ std::wcerr << "Warning: both -debug and -release were specified, defaulting to debug.\n";
+ if (forceDebug)
+ options->debugDetection = Options::DebugDetectionForceDebug;
+ else if (forceRelease)
+ options->debugDetection = Options::DebugDetectionForceRelease;
+
if (parser->isSet(forceOption))
options->updateFileFlags |= ForceUpdateFile;
if (parser->isSet(dryRunOption))
@@ -728,6 +752,9 @@ static DeployResult deploy(const Options &options,
if (!findDependentQtLibraries(libraryLocation, options.binary, options.platform, errorMessage, &dependentQtLibs, &wordSize, &isDebug, &directDependencyCount))
return result;
+ if (options.debugDetection != Options::DebugDetectionAuto)
+ isDebug = 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).
for (int m = 0; m < directDependencyCount; ++m)