| 557 | } |
| 558 | |
| 559 | bool cmStandardLevelResolver::AddRequiredTargetFeature( |
| 560 | cmTarget* target, std::string const& feature, std::string* error) const |
| 561 | { |
| 562 | if (cmGeneratorExpression::Find(feature) != std::string::npos) { |
| 563 | target->AppendProperty("COMPILE_FEATURES", feature, |
| 564 | this->Makefile->GetBacktrace()); |
| 565 | return true; |
| 566 | } |
| 567 | |
| 568 | std::string lang; |
| 569 | if (!this->CheckCompileFeaturesAvailable(target->GetName(), feature, lang, |
| 570 | error)) { |
| 571 | return false; |
| 572 | } |
| 573 | |
| 574 | target->AppendProperty("COMPILE_FEATURES", feature, |
| 575 | this->Makefile->GetBacktrace()); |
| 576 | |
| 577 | // FIXME: Add a policy to avoid updating the <LANG>_STANDARD target |
| 578 | // property due to COMPILE_FEATURES. The language standard selection |
| 579 | // should be done purely at generate time based on whatever the project |
| 580 | // code put in these properties explicitly. That is mostly true now, |
| 581 | // but for compatibility we need to continue updating the property here. |
| 582 | cm::optional<cmStandardLevel> featureLevel; |
| 583 | std::string newRequiredStandard; |
| 584 | bool succeeded = this->GetNewRequiredStandard( |
| 585 | target->GetName(), feature, |
| 586 | target->GetProperty(cmStrCat(lang, "_STANDARD")), featureLevel, |
| 587 | newRequiredStandard, error); |
| 588 | if (!newRequiredStandard.empty()) { |
| 589 | target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard); |
| 590 | } |
| 591 | return succeeded; |
| 592 | } |
| 593 | |
| 594 | bool cmStandardLevelResolver::CheckCompileFeaturesAvailable( |
| 595 | std::string const& targetName, std::string const& feature, std::string& lang, |
no test coverage detected