ProjectExplorer: Make runGcc work remotely

Plus a style nit.

Change-Id: I6f329926196cdbd9938e35437ab2be4e5bd1adc6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2021-04-29 13:12:24 +02:00
parent 5470d5d8d7
commit 999d22084d

View File

@@ -80,7 +80,7 @@ static const char binaryRegexp[] = "(?:^|-|\\b)(?:gcc|g\\+\\+|clang(?:\\+\\+)?)(
static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, const QStringList &env) static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, const QStringList &env)
{ {
if (gcc.isEmpty() || !gcc.toFileInfo().isExecutable()) if (!gcc.isExecutableFile())
return QByteArray(); return QByteArray();
SynchronousProcess cpp; SynchronousProcess cpp;
@@ -91,8 +91,7 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
cpp.setTimeoutS(10); cpp.setTimeoutS(10);
CommandLine cmdLine(gcc, arguments); CommandLine cmdLine(gcc, arguments);
SynchronousProcessResponse response = cpp.runBlocking(cmdLine); SynchronousProcessResponse response = cpp.runBlocking(cmdLine);
if (response.result != SynchronousProcessResponse::Finished || if (response.result != SynchronousProcessResponse::Finished || response.exitCode != 0) {
response.exitCode != 0) {
Core::MessageManager::writeFlashing({"Compiler feature detection failure!", Core::MessageManager::writeFlashing({"Compiler feature detection failure!",
response.exitMessage(cmdLine.toUserOutput(), 10), response.exitMessage(cmdLine.toUserOutput(), 10),
QString::fromUtf8(response.allRawOutput())}); QString::fromUtf8(response.allRawOutput())});