| 369 | using DefinitionsMap = std::map<std::string, DefinitionLanguageMap>; |
| 370 | |
| 371 | void AddDefinitions(cmMakefile* makefile, cmTarget* target, |
| 372 | cm::string_view configuration, |
| 373 | DefinitionsMap const& definitions) |
| 374 | { |
| 375 | for (auto const& di : definitions) { |
| 376 | auto const& g = di.second.find("*"_s); |
| 377 | if (g != di.second.end()) { |
| 378 | std::string const& def = BuildDefinition(di.first, g->second); |
| 379 | if (di.second.size() == 1) { |
| 380 | // Only the non-language-specific definition exists. |
| 381 | AddDefinition(makefile, target, configuration, def); |
| 382 | continue; |
| 383 | } |
| 384 | |
| 385 | // Create a genex to apply this definition to all languages except |
| 386 | // those that override it. |
| 387 | std::vector<cm::string_view> excludedLanguages; |
| 388 | for (auto const& li : di.second) { |
| 389 | if (li.first != "*"_s) { |
| 390 | excludedLanguages.emplace_back(li.first); |
| 391 | } |
| 392 | } |
| 393 | AddDefinition(makefile, target, configuration, |
| 394 | cmStrCat("$<$<NOT:$<COMPILE_LANGUAGE:"_s, |
| 395 | cmJoin(excludedLanguages, ","_s), ">>:"_s, def, |
| 396 | '>')); |
| 397 | } |
| 398 | |
| 399 | // Add language-specific definitions. |
| 400 | for (auto const& li : di.second) { |
| 401 | if (li.first != "*"_s) { |
| 402 | AddDefinition(makefile, target, configuration, |
| 403 | cmStrCat("$<$<COMPILE_LANGUAGE:"_s, li.first, ">:"_s, |
| 404 | BuildDefinition(di.first, li.second), '>')); |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | cm::optional<cmPackageInfoReader::Pep440Version> ParseSimpleVersion( |
| 411 | std::string const& version) |
no test coverage detected
searching dependent graphs…