forked from qt-creator/qt-creator
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>
(cherry picked from commit 86825283ed
)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -341,13 +341,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();
|
||||||
|
Reference in New Issue
Block a user