diff options
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c4b6e34..18b0ad1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1488,14 +1488,7 @@ const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg) // if the property has not yet been set, collect all languages in the // target and then find the language with the highest preference value std::set<cmStdString> languages; - for(std::vector<cmSourceFile*>::const_iterator - i = this->SourceFiles.begin(); i != this->SourceFiles.end(); ++i) - { - if(const char* lang = (*i)->GetLanguage()) - { - languages.insert(lang); - } - } + this->GetLanguages(languages); std::string linkerLangList; // only used for the error message int maxLinkerPref = 0; @@ -2369,3 +2362,16 @@ const char* cmTarget::GetExportMacro() return 0; } } + +//---------------------------------------------------------------------------- +void cmTarget::GetLanguages(std::set<cmStdString>& languages) const +{ + for(std::vector<cmSourceFile*>::const_iterator + i = this->SourceFiles.begin(); i != this->SourceFiles.end(); ++i) + { + if(const char* lang = (*i)->GetLanguage()) + { + languages.insert(lang); + } + } +} |