CMakePM: Allow loading of projects that do not have any targets

Fixes: QTCREATORBUG-25509
Change-Id: I4e56576f0d9fdffa50c81f4901fb30d17952553e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2021-09-16 18:04:58 +02:00
parent a88f1426c3
commit 86825283ed

View File

@@ -337,13 +337,6 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
static std::vector<Target> extractTargets(const QJsonArray &targets, QString &errorMessage) static std::vector<Target> extractTargets(const QJsonArray &targets, QString &errorMessage)
{ {
if (targets.isEmpty()) {
errorMessage
= QCoreApplication::translate("CMakeProjectManager::Internal",
"Invalid codemodel file generated by CMake: No targets.");
return {};
}
std::vector<Target> result; std::vector<Target> result;
for (const QJsonValue &v : targets) { for (const QJsonValue &v : targets) {
const QJsonObject obj = v.toObject(); const QJsonObject obj = v.toObject();