forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user