MCPcopy Create free account
hub / github.com/Kitware/CMake / AppendLanguageProperties

Function AppendLanguageProperties

Source/cmPackageInfoReader.cxx:275–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273
274template <typename Transform>
275void AppendLanguageProperties(cmMakefile* makefile, cmTarget* target,
276 cm::string_view property,
277 cm::string_view configuration,
278 Json::Value const& data, char const* key,
279 Transform transform)
280{
281 Json::Value const& value = data[key];
282 if (value.isArray()) {
283 for (std::string v : ReadList(value)) {
284 AppendProperty(makefile, target, property, configuration,
285 transform(std::move(v)));
286 }
287 } else if (value.isObject()) {
288 for (auto vi = value.begin(), ve = value.end(); vi != ve; ++vi) {
289 cm::string_view const originalLang = IterKey(vi);
290 cm::string_view const lang = MapLanguage(originalLang);
291 if (lang.empty()) {
292 makefile->IssueMessage(MessageType::WARNING,
293 cmStrCat(R"(ignoring unknown language ")"_s,
294 originalLang, R"(" in )"_s, key,
295 " for "_s, target->GetName()));
296 continue;
297 }
298
299 if (lang == "*"_s) {
300 for (std::string v : ReadList(*vi)) {
301 AppendProperty(makefile, target, property, configuration,
302 transform(std::move(v)));
303 }
304 } else {
305 for (std::string v : ReadList(*vi)) {
306 v = cmStrCat("$<$<COMPILE_LANGUAGE:"_s, lang, ">:"_s,
307 transform(std::move(v)), '>');
308 AppendProperty(makefile, target, property, configuration, v);
309 }
310 }
311 }
312 }
313}
314
315void AddCompileFeature(cmMakefile* makefile, cmTarget* target,
316 cm::string_view configuration, std::string const& value)

Callers 1

SetTargetPropertiesMethod · 0.85

Calls 14

ReadListFunction · 0.85
AppendPropertyFunction · 0.85
transformFunction · 0.85
moveFunction · 0.85
IterKeyFunction · 0.85
MapLanguageFunction · 0.85
isArrayMethod · 0.80
isObjectMethod · 0.80
cmStrCatFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…