summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2023-05-08 17:59:26 +0200
committerCristian Adam <cristian.adam@qt.io>2023-05-12 08:17:17 +0000
commitaf5e50edf73b98fc7b995906b8ddd492756bff52 (patch)
tree3174733f7aca74fe66b6239d452474d3b46ef2a6
parent430f07cf383954312c4ee2908b0c344b207cab9e (diff)
downloadqt-creator-af5e50edf73b98fc7b995906b8ddd492756bff52.tar.gz
CMakePM: Cancel current build before locator "cm <target>"
In case the current project is building and the user starts a "cm <target>" in Locator, now the build is canceled before starting a a "cmake --build --target <target>". Fixes: QTCREATORBUG-26699 Change-Id: I27ed9ba5b8d917dce94835a5462e4e64e7515bd9 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp
index ab646d1fa6..0eab601200 100644
--- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp
@@ -122,6 +122,9 @@ void BuildCMakeTargetLocatorFilter::accept(const Core::LocatorFilterEntry &selec
|| !cmakeProject->activeTarget()->activeBuildConfiguration())
return;
+ if (BuildManager::isBuilding(cmakeProject))
+ BuildManager::cancel();
+
// Find the make step
BuildStepList *buildStepList =
cmakeProject->activeTarget()->activeBuildConfiguration()->buildSteps();