Skip to content

Commit

Permalink
GccToolchain: Print command line arguments and error message
Browse files Browse the repository at this point in the history
In case of compiler toolchain defines autodetection print relevant
information needed to find out why it failed.

Change-Id: I03ff5d01c39c06bd4c3a24ad51688a7a701a3c33
Reviewed-by: hjk <hjk@qt.io>
  • Loading branch information
cristianadam committed Oct 1, 2019
1 parent 016ad4a commit b4022f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/projectexplorer/gcctoolchain.cpp
Expand Up @@ -32,6 +32,7 @@
#include "toolchainmanager.h"

#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>

#include <utils/algorithm.h>
#include <utils/environment.h>
Expand Down Expand Up @@ -88,10 +89,13 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons

cpp.setEnvironment(environment);
cpp.setTimeoutS(10);
SynchronousProcessResponse response = cpp.runBlocking(CommandLine(gcc, arguments));
CommandLine cmdLine(gcc, arguments);
SynchronousProcessResponse response = cpp.runBlocking(cmdLine);
if (response.result != SynchronousProcessResponse::Finished ||
response.exitCode != 0) {
qWarning() << response.exitMessage(gcc.toString(), 10);
Core::MessageManager::write("Compiler feature detection failure!");
Core::MessageManager::write(response.exitMessage(cmdLine.toUserOutput(), 10));
Core::MessageManager::write(QString::fromUtf8(response.allRawOutput()));
return QByteArray();
}

Expand Down

0 comments on commit b4022f9

Please sign in to comment.