Skip to content
Snippets Groups Projects
Commit 62e4c92f authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Stop build on fatal make errors

... ignoring a error code of 0 from Make. This is necessary to
detect build failures on symbian

Do not show errors when ignoring the return value of a BuildStep
either.

Task-number: QTCREATORBUG-985
Reviewed-by: dt
parent 8cf30e86
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,8 @@ namespace {
}
GnuMakeParser::GnuMakeParser(const QString &dir) :
m_suppressIssues(false)
m_suppressIssues(false),
m_fatalErrorCount(0)
{
m_makeDir.setPattern(QLatin1String(MAKE_PATTERN) +
QLatin1String("(\\w+) directory .(.+).$"));
......@@ -55,6 +56,11 @@ GnuMakeParser::GnuMakeParser(const QString &dir) :
addDirectory(dir);
}
int GnuMakeParser::fatalErrors() const
{
return m_fatalErrorCount;
}
void GnuMakeParser::stdOutput(const QString &line)
{
QString lne = line.trimmed();
......@@ -75,6 +81,7 @@ void GnuMakeParser::stdError(const QString &line)
QString lne = line.trimmed();
if (m_makefileError.indexIn(lne) > -1) {
++m_fatalErrorCount;
if (!m_suppressIssues) {
m_suppressIssues = true;
addTask(Task(Task::Error,
......@@ -86,6 +93,7 @@ void GnuMakeParser::stdError(const QString &line)
return;
}
if (m_makeLine.indexIn(lne) > -1) {
++m_fatalErrorCount;
if (!m_suppressIssues) {
m_suppressIssues = true;
addTask(Task(Task::Error,
......
......@@ -49,6 +49,8 @@ public:
QStringList searchDirectories() const;
int fatalErrors() const;
public slots:
virtual void taskAdded(const ProjectExplorer::Task &task);
......@@ -66,6 +68,8 @@ private:
friend class ProjectExplorerPlugin;
#endif
bool m_suppressIssues;
int m_fatalErrorCount;
};
} // namespace ProjectExplorer
......
......@@ -187,6 +187,16 @@ void MakeStep::run(QFutureInterface<bool> & fi)
AbstractProcessStep::run(fi);
}
bool MakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
{
// Symbian does retun 0, even on failed makes! So we check for fatal make errors here.
ProjectExplorer::GnuMakeParser *parser = qobject_cast<ProjectExplorer::GnuMakeParser *>(outputParser());
if (parser && parser->fatalErrors() != 0)
return false;
return AbstractProcessStep::processSucceeded(exitCode, status);
}
bool MakeStep::immutable() const
{
return false;
......
......@@ -86,6 +86,8 @@ public:
virtual bool init();
virtual void run(QFutureInterface<bool> &);
bool processSucceeded(int exitCode, QProcess::ExitStatus status);
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const;
QStringList userArguments();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment