From cb39e2404cbf8600997c0abffca9a93159d6d7aa Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 May 2021 12:21:04 +0200 Subject: [PATCH] ProjectExplorer: Use run device as fallback for build device This is not necessarily a permanent solution, but does something sensible and suppresses warnings about non-existent build devices. Alternatives would be to always enforce the existence of a build device (fallback to "Desktop") as done for the run device, or enforce a build device only and consider "no run device" as "same as build device. Change-Id: Ib84670c63a6c416524ab4740419ede6b99981c43 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/kitinformation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 7ee074bcf26..9f2f70e87da 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -1301,7 +1301,12 @@ Utils::Id BuildDeviceKitAspect::id() IDevice::ConstPtr BuildDeviceKitAspect::device(const Kit *k) { QTC_ASSERT(DeviceManager::instance()->isLoaded(), return IDevice::ConstPtr()); - return DeviceManager::instance()->find(deviceId(k)); + IDevice::ConstPtr dev = DeviceManager::instance()->find(deviceId(k)); + // Use the "run" device as fallback if no build device is present. + // FIXME: Think about whether this shouldn't be the other way round. + if (!dev) + dev = DeviceKitAspect::device(k); + return dev; } Utils::Id BuildDeviceKitAspect::deviceId(const Kit *k)