| 273 | |
| 274 | template <typename Transform> |
| 275 | void 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 | |
| 315 | void AddCompileFeature(cmMakefile* makefile, cmTarget* target, |
| 316 | cm::string_view configuration, std::string const& value) |
no test coverage detected
searching dependent graphs…