diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-01 16:39:57 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-02 14:26:34 +0000 |
commit | a3292031295a09e5e959141db78c2310e08562ae (patch) | |
tree | e6124ee72f95fbd578d6a3221af161a6cad6b367 /tools | |
parent | 8be1c3fae88c265fb3955e14c453ebf4b4e19275 (diff) |
configure.exe: Add -verbose option.
Make it possible to inspect the output of the configure tests.
Task-number: QTBUG-48525
Change-Id: If93d597679ae1b189dfdaa485852d34cad52593b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 20 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c54bc9426e..d4ea0f6d04 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -83,7 +83,7 @@ static inline void promptKeyPress() exit(0); // Exit cleanly for Ctrl+C } -Configure::Configure(int& argc, char** argv) +Configure::Configure(int& argc, char** argv) : verbose(0) { // Default values for indentation optionIndent = 4; @@ -383,6 +383,7 @@ void Configure::parseCmdLine() configCmdLine.clear(); reloadCmdLine(); } + else if (configCmdLine.at(i) == "-loadconfig") { ++i; if (i != argCount) { @@ -420,6 +421,10 @@ void Configure::parseCmdLine() || configCmdLine.at(i) == "-?") dictionary[ "HELP" ] = "yes"; + else if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") { + ++verbose; + } + else if (configCmdLine.at(i) == "-qconfig") { ++i; if (i == argCount) @@ -2058,6 +2063,7 @@ bool Configure::displayHelp() desc( "-loadconfig <config>", "Run configure with the parameters from file configure_<config>.cache."); desc( "-saveconfig <config>", "Run configure and save the parameters in file configure_<config>.cache."); desc( "-redo", "Run configure with the same parameters as last time.\n"); + desc( "-v, -verbose", "Run configure tests with verbose output.\n"); // Qt\Windows CE only options go below here ----------------------------------------------------------------------------- desc("Qt for Windows CE only:\n\n"); @@ -3377,7 +3383,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext } // run qmake - QString command = QString("%1 %2 %3 2>&1") + QString command = QString("%1 %2 %3") .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")), QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath), extraOptions); @@ -3389,6 +3395,11 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext addSysroot(&command); } + if (verbose) + cout << qPrintable(command) << endl; + else + command += " 2>&1"; + int code = 0; QString output = Environment::execute(command, &code); //cout << output << endl; @@ -3398,7 +3409,10 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext command = dictionary[ "MAKE" ]; if (command.contains("nmake") || command.contains("jom")) command += " /NOLOGO"; - command += " -s 2>&1"; + if (verbose) + cout << qPrintable(command) << endl; + else + command += " -s 2>&1"; output = Environment::execute(command, &code); //cout << output << endl; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index de8d1a2469..78cc118a9d 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -93,6 +93,8 @@ public: private: bool checkAngleAvailability(QString *errorMessage = 0) const; + int verbose; + // Our variable dictionaries QMap<QString,QString> dictionary; QStringList allBuildParts; |