forked from qt-creator/qt-creator
Compile: add ability to parse standard output in build
When working with make wrapper scripts, sometimes they forward everything to stdout. When this happens failures are not parsed, and the are not "clickable" in QtC. This patch adds an option to enable parsing of standard output. Change-Id: I44b283dbdf6286f90c546898d496bff41de0d5ed Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -217,6 +217,7 @@ public:
|
||||
bool boldFontEnabled = true;
|
||||
bool prependCarriageReturn = false;
|
||||
bool prependLineFeed = false;
|
||||
bool forwardStdOutToStdError = false;
|
||||
};
|
||||
|
||||
OutputFormatter::OutputFormatter() : d(new Private) { }
|
||||
@@ -574,6 +575,11 @@ void OutputFormatter::setBoldFontEnabled(bool enabled)
|
||||
d->formats[ErrorMessageFormat].setFontWeight(fontWeight);
|
||||
}
|
||||
|
||||
void OutputFormatter::setForwardStdOutToStdError(bool enabled)
|
||||
{
|
||||
d->forwardStdOutToStdError = enabled;
|
||||
}
|
||||
|
||||
void OutputFormatter::flush()
|
||||
{
|
||||
if (!d->incompleteLine.first.isEmpty())
|
||||
@@ -608,7 +614,7 @@ void OutputFormatter::dropSearchDir(const FilePath &dir)
|
||||
OutputFormat OutputFormatter::outputTypeForParser(const OutputLineParser *parser,
|
||||
OutputFormat type) const
|
||||
{
|
||||
if (type == StdOutFormat && parser->needsRedirection())
|
||||
if (type == StdOutFormat && (parser->needsRedirection() || d->forwardStdOutToStdError))
|
||||
return StdErrFormat;
|
||||
return type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user