diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-06-18 19:03:44 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-06-22 18:27:20 +0000 |
commit | 92139f18b0ce0d6906f31fcf51913fb2e27c431e (patch) | |
tree | 268f94d75dc15ebf25b70daee18d28020607516f | |
parent | 14d83e027bad10dbe7363220043a5d0a622cbc4a (diff) |
McuSupport: Improve version checking, support Desktop-only installation
Due to the missing .json file for desktop targets, the Desktop target
was only listed in the target chooser if at least one hardware target
(which do have .json files) was installed in the SDK. This prevented
using of Desktop-only Qt for MCUs installations.
This change causes the Desktop target to be listed if the respective
library exists. With a Desktop-only Qt for MCUs installation, this means
that we blindly trust that the selected Qt for MCUs SDK version is
supported.
On the other hand we make the version checking stricter (in case we do
find .json files). If the version of one targets does not match, the
whole SDK installation is deemed invalid and no target is listed, also
none for Desktop.
Change-Id: I9d83b22255c19c5f8c6360e0b6137ce40311f8c4
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/mcusupport/mcusupportsdk.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index 7dd7967997..d87038c8a0 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -344,17 +344,17 @@ void targetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage *> *packa const McuTargetDescription desc = parseDescriptionJson(file.readAll()); if (!McuSupportOptions::supportedQulVersion() .isPrefixOf(QVersionNumber::fromString(desc.qulVersion))) - continue; + return; // Invalid version means invalid SDK installation. descriptions.append(desc); } - if (!descriptions.isEmpty()) { - // Workaround for missing JSON file for Desktop target: + // Workaround for missing JSON file for Desktop target: + if (dir.pathAppended("/lib/QulQuickUltralite_QT_32bpp_Windows_Release.lib").exists()) { descriptions.prepend({McuSupportOptions::supportedQulVersion().toString(), {"Qt"}, {"Qt"}, {32}, {"desktop"}, {}, {}}); - - mcuTargets->append(targetsFromDescriptions(descriptions, packages)); } + + mcuTargets->append(targetsFromDescriptions(descriptions, packages)); } } // namespace Sdk |