Commit 2af168e1 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Do not try to build in Qt4 makestep without a tool chain

Reviewed-by: dt
parent 3664d205
......@@ -43,6 +43,7 @@
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcprocess.h>
......@@ -129,6 +130,14 @@ bool MakeStep::fromMap(const QVariantMap &map)
bool MakeStep::init()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
if (!bc->toolChain()) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
tr("Qt Creator needs a tool chain set up to build. Please configure a tool chain in Project mode."),
QString(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
}
ProjectExplorer::ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
......@@ -205,6 +214,20 @@ void MakeStep::run(QFutureInterface<bool> & fi)
return;
}
// Warn on common error conditions:
bool canContinue = true;
foreach (const ProjectExplorer::Task &t, m_tasks) {
addTask(t);
if (t.type == ProjectExplorer::Task::Error)
canContinue = false;
}
if (!canContinue) {
emit addOutput(tr("Configuration is faulty, please check the Build Issues view for details."), BuildStep::MessageOutput);
fi.reportResult(false);
return;
}
AbstractProcessStep::run(fi);
}
......
......@@ -36,6 +36,7 @@
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/task.h>
QT_BEGIN_NAMESPACE
namespace Ui {
......@@ -116,6 +117,7 @@ private:
bool m_clean;
QString m_userArgs;
QString m_makeCmd;
QList<ProjectExplorer::Task> m_tasks;
};
class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment