Commit 0a5f32ff authored by Tobias Hunger's avatar Tobias Hunger

CMake: Fix crashes when last target is removed from a project

Task-number: QTCREATORBUG-19112
Change-Id: I17893c3e15e9cabc09bf5ebb6746a5d76d9cc0bd
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 87cd4495
......@@ -140,6 +140,9 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
connect(this, &Project::activeTargetChanged, this, [this]() {
CMakeBuildConfiguration *bc = activeBc(this);
if (!bc)
return;
// Target has switched, so the kit has changed, too.
// * run cmake with configuration arguments if the reader needs to be switched
// * run cmake without configuration arguments if the reader stays
......@@ -153,6 +156,9 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
subscribeSignal(&Target::activeBuildConfigurationChanged, this, [this]() {
CMakeBuildConfiguration *bc = activeBc(this);
if (!bc)
return;
// Build configuration has switched:
// * Error out if the reader updates, can not happen since all BCs share a target/kit.
// * run cmake without configuration arguments if the reader stays
......
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