cmGlobalGenerator: Store languages as vector, not map.
The second component of the map is never used.
This commit is contained in:
parent
18b58b618c
commit
55ecd818f6
@ -968,7 +968,13 @@ void cmGlobalGenerator::SetLanguageEnabled(const std::string& l,
|
|||||||
void cmGlobalGenerator::SetLanguageEnabledFlag(const std::string& l,
|
void cmGlobalGenerator::SetLanguageEnabledFlag(const std::string& l,
|
||||||
cmMakefile* mf)
|
cmMakefile* mf)
|
||||||
{
|
{
|
||||||
this->LanguageEnabled[l] = true;
|
std::vector<std::string>::iterator it =
|
||||||
|
std::lower_bound(this->LanguageEnabled.begin(),
|
||||||
|
this->LanguageEnabled.end(), l);
|
||||||
|
if (it == this->LanguageEnabled.end() || *it != l)
|
||||||
|
{
|
||||||
|
this->LanguageEnabled.insert(it, l);
|
||||||
|
}
|
||||||
|
|
||||||
// Fill the language-to-extension map with the current variable
|
// Fill the language-to-extension map with the current variable
|
||||||
// settings to make sure it is available for the try_compile()
|
// settings to make sure it is available for the try_compile()
|
||||||
@ -1079,7 +1085,8 @@ bool cmGlobalGenerator::IgnoreFile(const char* ext) const
|
|||||||
|
|
||||||
bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const
|
bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const
|
||||||
{
|
{
|
||||||
return (this->LanguageEnabled.find(l)!= this->LanguageEnabled.end());
|
return std::binary_search(this->LanguageEnabled.begin(),
|
||||||
|
this->LanguageEnabled.end(), l);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::ClearEnabledLanguages()
|
void cmGlobalGenerator::ClearEnabledLanguages()
|
||||||
@ -1958,11 +1965,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
|||||||
void
|
void
|
||||||
cmGlobalGenerator::GetEnabledLanguages(std::vector<std::string>& lang) const
|
cmGlobalGenerator::GetEnabledLanguages(std::vector<std::string>& lang) const
|
||||||
{
|
{
|
||||||
for(std::map<std::string, bool>::const_iterator i =
|
lang = this->LanguageEnabled;
|
||||||
this->LanguageEnabled.begin(); i != this->LanguageEnabled.end(); ++i)
|
|
||||||
{
|
|
||||||
lang.push_back(i->first);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmGlobalGenerator::GetLinkerPreference(const std::string& lang) const
|
int cmGlobalGenerator::GetLinkerPreference(const std::string& lang) const
|
||||||
|
@ -441,7 +441,7 @@ private:
|
|||||||
// If you add a new map here, make sure it is copied
|
// If you add a new map here, make sure it is copied
|
||||||
// in EnableLanguagesFromGenerator
|
// in EnableLanguagesFromGenerator
|
||||||
std::map<std::string, bool> IgnoreExtensions;
|
std::map<std::string, bool> IgnoreExtensions;
|
||||||
std::map<std::string, bool> LanguageEnabled;
|
std::vector<std::string> LanguageEnabled;
|
||||||
std::set<std::string> LanguagesReady; // Ready for try_compile
|
std::set<std::string> LanguagesReady; // Ready for try_compile
|
||||||
std::map<std::string, std::string> OutputExtensions;
|
std::map<std::string, std::string> OutputExtensions;
|
||||||
std::map<std::string, std::string> LanguageToOutputExtension;
|
std::map<std::string, std::string> LanguageToOutputExtension;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user