Commit d5f2dc0d authored by Daniel Teske's avatar Daniel Teske

CMake: MakeStep consistently check that we have a buildconfiguration

Technically the user can only get into a no buildconfiguration state
with broken settings. But we should either check everywhere or nowhere.

Change-Id: Ibdc831b66e6cf141c8d25bafed7e568e3cff2ab1
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent d24e5096
......@@ -180,13 +180,22 @@ bool MakeStep::init()
{
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
if (!bc)
bc = static_cast<CMakeBuildConfiguration *>(target()->activeBuildConfiguration());
bc = targetsActiveBuildConfiguration();
if (!bc) {
emit addTask(Task(Task::Error, tr("Qt Creator needs a build configuration set up to build. Configure a build configuration in the project settings."),
Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
if (!tc) {
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,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
if (!bc || !tc) {
emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), BuildStep::MessageOutput);
return false;
}
......
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