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

Method ComputeTargetCompileFeatures

Source/cmLocalGenerator.cxx:825–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825bool cmLocalGenerator::ComputeTargetCompileFeatures()
826{
827 // Collect the set of configuration types.
828 std::vector<std::string> configNames =
829 this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
830
831 using LanguagePair = std::pair<std::string, std::string>;
832 std::vector<LanguagePair> pairedLanguages{
833 { "OBJC", "C" }, { "OBJCXX", "CXX" }, { "CUDA", "CXX" }, { "HIP", "CXX" }
834 };
835 std::set<LanguagePair> inferredEnabledLanguages;
836 for (auto const& lang : pairedLanguages) {
837 if (this->Makefile->GetState()->GetLanguageEnabled(lang.first)) {
838 inferredEnabledLanguages.insert(lang);
839 }
840 }
841
842 // Process compile features of all targets.
843 auto const& targets = this->GetGeneratorTargets();
844 for (auto const& target : targets) {
845 for (std::string const& c : configNames) {
846 if (!target->ComputeCompileFeatures(c)) {
847 return false;
848 }
849 }
850
851 // Now that C/C++ _STANDARD values have been computed
852 // set the values to ObjC/ObjCXX _STANDARD variables
853 if (target->CanCompileSources()) {
854 for (std::string const& c : configNames) {
855 target->ComputeCompileFeatures(c, inferredEnabledLanguages);
856 }
857 }
858 }
859
860 return true;
861}
862
863bool cmLocalGenerator::IsRootMakefile() const
864{

Callers 1

ComputeMethod · 0.80

Calls 6

GetGeneratorConfigsMethod · 0.80
GetLanguageEnabledMethod · 0.45
GetStateMethod · 0.45
insertMethod · 0.45
CanCompileSourcesMethod · 0.45

Tested by

no test coverage detected