| 592 | } |
| 593 | |
| 594 | bool cmStandardLevelResolver::CheckCompileFeaturesAvailable( |
| 595 | std::string const& targetName, std::string const& feature, std::string& lang, |
| 596 | std::string* error) const |
| 597 | { |
| 598 | if (!this->CompileFeatureKnown(targetName, feature, lang, error)) { |
| 599 | return false; |
| 600 | } |
| 601 | |
| 602 | if (!this->Makefile->GetGlobalGenerator()->GetLanguageEnabled(lang)) { |
| 603 | return true; |
| 604 | } |
| 605 | |
| 606 | cmValue features = this->CompileFeaturesAvailable(lang, error); |
| 607 | if (!features) { |
| 608 | return false; |
| 609 | } |
| 610 | |
| 611 | cmList availableFeatures{ features }; |
| 612 | if (!cm::contains(availableFeatures, feature)) { |
| 613 | std::ostringstream e; |
| 614 | e << "The compiler feature \"" << feature << "\" is not known to " << lang |
| 615 | << " compiler\n\"" |
| 616 | << this->Makefile->GetSafeDefinition( |
| 617 | cmStrCat("CMAKE_", lang, "_COMPILER_ID")) |
| 618 | << "\"\nversion " |
| 619 | << this->Makefile->GetSafeDefinition( |
| 620 | cmStrCat("CMAKE_", lang, "_COMPILER_VERSION")) |
| 621 | << '.'; |
| 622 | if (error) { |
| 623 | *error = e.str(); |
| 624 | } else { |
| 625 | this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); |
| 626 | } |
| 627 | return false; |
| 628 | } |
| 629 | |
| 630 | return true; |
| 631 | } |
| 632 | |
| 633 | bool cmStandardLevelResolver::CompileFeatureKnown( |
| 634 | std::string const& targetName, std::string const& feature, std::string& lang, |
no test coverage detected