diff options
author | Eike Ziller <[email protected]> | 2025-09-10 16:22:41 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2025-09-10 14:46:20 +0000 |
commit | de12a77389e0e0c8941b74b25ec07ff12f01f077 (patch) | |
tree | 7dd728172e1d76016040bf2b4015b239c47cb0f7 | |
parent | faecd8d4475a2e21fb84bbd06b624099affed94e (diff) |
CMake: Do not set default tool if it doesn't match build device
Follows up on 27baac8a68fec20f9229b1e4773ccb0a27fa52f3
Change-Id: Ibb556908755e7add3deb176eea4cd1627c40dfdb
Reviewed-by: Christian Kandeler <[email protected]>
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index 6a6946b6fae..c2384620963 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -317,9 +317,11 @@ void CMakeKitAspectFactory::setup(Kit *k) if (cmakeTool(k)) return; + const QList<CMakeTool *> matchingTools = toolsForBuildDevice(k); // Look for a suitable auto-detected one: const QString kitSource = k->detectionSource().id; - for (CMakeTool *tool : toolsForBuildDevice(k)) { + + for (CMakeTool *tool : matchingTools) { const QString toolSource = tool->detectionSource().id; if (!toolSource.isEmpty() && toolSource == kitSource) { CMakeKitAspect::setCMakeExecutable(k, tool->cmakeExecutable()); @@ -327,7 +329,8 @@ void CMakeKitAspectFactory::setup(Kit *k) } } - CMakeKitAspect::setCMakeExecutable(k, defaultCMakeExecutable()); + if (matchingTools.contains(CMakeToolManager::defaultCMakeTool())) + CMakeKitAspect::setCMakeExecutable(k, defaultCMakeExecutable()); } void CMakeKitAspectFactory::fix(Kit *k) |