forked from qt-creator/qt-creator
CMake: MakeStep: Simplfy code
Change-Id: I4de1ceecc1f0602d0c58ee3e411d43b15437dffb Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -182,13 +182,13 @@ bool MakeStep::init()
|
|||||||
if (!bc)
|
if (!bc)
|
||||||
bc = static_cast<CMakeBuildConfiguration *>(target()->activeBuildConfiguration());
|
bc = static_cast<CMakeBuildConfiguration *>(target()->activeBuildConfiguration());
|
||||||
|
|
||||||
m_tasks.clear();
|
|
||||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
m_tasks.append(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."),
|
emit addTask(Task(Task::Error, tr("Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."),
|
||||||
Utils::FileName(), -1,
|
Utils::FileName(), -1,
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||||
return true; // otherwise the tasks will not get reported
|
emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), BuildStep::MessageOutput);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString arguments = Utils::QtcProcess::joinArgs(m_buildTargets);
|
QString arguments = Utils::QtcProcess::joinArgs(m_buildTargets);
|
||||||
@@ -221,18 +221,6 @@ bool MakeStep::init()
|
|||||||
|
|
||||||
void MakeStep::run(QFutureInterface<bool> &fi)
|
void MakeStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
bool canContinue = true;
|
|
||||||
foreach (const Task &t, m_tasks) {
|
|
||||||
addTask(t);
|
|
||||||
canContinue = false;
|
|
||||||
}
|
|
||||||
if (!canContinue) {
|
|
||||||
emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), BuildStep::MessageOutput);
|
|
||||||
fi.reportResult(false);
|
|
||||||
emit finished();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractProcessStep::run(fi);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ private:
|
|||||||
QString m_ninjaProgressString;
|
QString m_ninjaProgressString;
|
||||||
QStringList m_buildTargets;
|
QStringList m_buildTargets;
|
||||||
QString m_additionalArguments;
|
QString m_additionalArguments;
|
||||||
QList<ProjectExplorer::Task> m_tasks;
|
|
||||||
bool m_useNinja;
|
bool m_useNinja;
|
||||||
CMakeBuildConfiguration *m_activeConfiguration;
|
CMakeBuildConfiguration *m_activeConfiguration;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user