forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -344,17 +344,17 @@ void targetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage *> *packa
|
|||||||
const McuTargetDescription desc = parseDescriptionJson(file.readAll());
|
const McuTargetDescription desc = parseDescriptionJson(file.readAll());
|
||||||
if (!McuSupportOptions::supportedQulVersion()
|
if (!McuSupportOptions::supportedQulVersion()
|
||||||
.isPrefixOf(QVersionNumber::fromString(desc.qulVersion)))
|
.isPrefixOf(QVersionNumber::fromString(desc.qulVersion)))
|
||||||
continue;
|
return; // Invalid version means invalid SDK installation.
|
||||||
descriptions.append(desc);
|
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(),
|
descriptions.prepend({McuSupportOptions::supportedQulVersion().toString(),
|
||||||
{"Qt"}, {"Qt"}, {32}, {"desktop"}, {}, {}});
|
{"Qt"}, {"Qt"}, {32}, {"desktop"}, {}, {}});
|
||||||
|
}
|
||||||
|
|
||||||
mcuTargets->append(targetsFromDescriptions(descriptions, packages));
|
mcuTargets->append(targetsFromDescriptions(descriptions, packages));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Sdk
|
} // namespace Sdk
|
||||||
|
Reference in New Issue
Block a user