Changeset View
Changeset View
Standalone View
Standalone View
plugins/cmake/cmakeserverimportjob.cpp
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 107 | for (const auto &targetObject: targets) { | |||
---|---|---|---|---|---|
110 | 110 | | |||
111 | KDevelop::Path::List targetSources; | 111 | KDevelop::Path::List targetSources; | ||
112 | const auto fileGroups = target.value(QStringLiteral("fileGroups")).toArray(); | 112 | const auto fileGroups = target.value(QStringLiteral("fileGroups")).toArray(); | ||
113 | for (const auto &fileGroupValue: fileGroups) { | 113 | for (const auto &fileGroupValue: fileGroups) { | ||
114 | const auto fileGroup = fileGroupValue.toObject(); | 114 | const auto fileGroup = fileGroupValue.toObject(); | ||
115 | CMakeFile file; | 115 | CMakeFile file; | ||
116 | file.includes = kTransform<KDevelop::Path::List>(fileGroup.value(QStringLiteral("includePath")).toArray(), [](const QJsonValue& val) { return KDevelop::Path(val.toObject().value(QStringLiteral("path")).toString()); }); | 116 | file.includes = kTransform<KDevelop::Path::List>(fileGroup.value(QStringLiteral("includePath")).toArray(), [](const QJsonValue& val) { return KDevelop::Path(val.toObject().value(QStringLiteral("path")).toString()); }); | ||
117 | 117 | | |||
118 | file.language = fileGroup.value(QStringLiteral("language")).toString(), | ||||
118 | file.compileFlags = fileGroup.value(QStringLiteral("compileFlags")).toString(); | 119 | file.compileFlags = fileGroup.value(QStringLiteral("compileFlags")).toString(); | ||
119 | file.defines = processDefines(file.compileFlags, fileGroup.value(QStringLiteral("defines")).toArray()); | 120 | file.defines = processDefines(file.compileFlags, fileGroup.value(QStringLiteral("defines")).toArray()); | ||
120 | 121 | | |||
121 | const auto sourcesArray = fileGroup.value(QStringLiteral("sources")).toArray(); | 122 | const auto sourcesArray = fileGroup.value(QStringLiteral("sources")).toArray(); | ||
122 | const KDevelop::Path::List sources = kTransform<KDevelop::Path::List>(sourcesArray, [targetDir](const QJsonValue& val) { return KDevelop::Path(targetDir, val.toString()); }); | 123 | const KDevelop::Path::List sources = kTransform<KDevelop::Path::List>(sourcesArray, [targetDir](const QJsonValue& val) { return KDevelop::Path(targetDir, val.toString()); }); | ||
123 | for (const auto& source: sources) { | 124 | for (const auto& source: sources) { | ||
124 | // NOTE: we use the canonical file path to prevent issues with symlinks in the path | 125 | // NOTE: we use the canonical file path to prevent issues with symlinks in the path | ||
125 | // leading to lookup failures | 126 | // leading to lookup failures | ||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |