diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2012-09-06 13:13:12 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2012-09-06 16:52:21 +0200 |
commit | 9d90f8b396e8e42e4181edf6cb87d2ae7deddead (patch) | |
tree | 05b8085bb713e6ec66de87da2bb447d0ccfd0cb0 /src/plugins/genericprojectmanager/genericmakestep.cpp | |
parent | 8b05f1afafb044b3f3ca7eeead2e106fb9aa3e28 (diff) | |
download | qt-creator-9d90f8b396e8e42e4181edf6cb87d2ae7deddead.tar.gz |
Warn if kit has no tool chain set up
Change-Id: I551402c1e3023feeeb127f001a0e908938a07fc2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/genericprojectmanager/genericmakestep.cpp')
-rw-r--r-- | src/plugins/genericprojectmanager/genericmakestep.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index 6100366af4..f66b78f961 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -106,6 +106,15 @@ bool GenericMakeStep::init() if (!bc) bc = static_cast<GenericBuildConfiguration *>(target()->activeBuildConfiguration()); + m_tasks.clear(); + ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit()); + 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."), + Utils::FileName(), -1, + Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); + return true; // otherwise the tasks will not get reported + } + ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory()); @@ -119,7 +128,6 @@ bool GenericMakeStep::init() setIgnoreReturnValue(m_clean); setOutputParser(new GnuMakeParser()); - ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit()); if (tc) appendOutputParser(tc->outputParser()); outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); @@ -180,6 +188,17 @@ QString GenericMakeStep::makeCommand() const void GenericMakeStep::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); + return; + } + AbstractProcessStep::run(fi); } |