cmGlobalGenerator: Finish storing enabled languages in cmState

In commit 74de9a73 (cmGlobalGenerator: Delegate storage of enabled
languages to cmState, 2015-04-11) the original LanguageEnabled
member of cmGlobalGenerator was left behind by mistake.  One use
of it in EnableLanguagesFromGenerator (for try_compile) was left,
but the member is not populated anymore.  Drop the member and
teach EnableLanguagesFromGenerator to copy the list of enabled
languages from one cmState to the other.

Reported-by: Matt McCormick <matt.mccormick@kitware.com>
This commit is contained in:
Brad King 2015-04-30 08:56:48 -04:00
parent 8469b6f694
commit 27343e3b68
4 changed files with 9 additions and 2 deletions

View File

@ -1896,7 +1896,9 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
"make program",
cmState::FILEPATH);
// copy the enabled languages
this->LanguageEnabled = gen->LanguageEnabled;
this->GetCMakeInstance()->GetState()->SetEnabledLanguages(
gen->GetCMakeInstance()->GetState()->GetEnabledLanguages()
);
this->LanguagesReady = gen->LanguagesReady;
this->ExtensionToLanguage = gen->ExtensionToLanguage;
this->IgnoreExtensions = gen->IgnoreExtensions;

View File

@ -441,7 +441,6 @@ private:
// If you add a new map here, make sure it is copied
// in EnableLanguagesFromGenerator
std::map<std::string, bool> IgnoreExtensions;
std::vector<std::string> LanguageEnabled;
std::set<std::string> LanguagesReady; // Ready for try_compile
std::map<std::string, std::string> OutputExtensions;
std::map<std::string, std::string> LanguageToOutputExtension;

View File

@ -272,6 +272,11 @@ std::vector<std::string> cmState::GetEnabledLanguages() const
return this->EnabledLanguages;
}
void cmState::SetEnabledLanguages(std::vector<std::string> const& langs)
{
this->EnabledLanguages = langs;
}
void cmState::ClearEnabledLanguages()
{
this->EnabledLanguages.clear();

View File

@ -77,6 +77,7 @@ public:
void SetLanguageEnabled(std::string const& l);
bool GetLanguageEnabled(std::string const& l) const;
std::vector<std::string> GetEnabledLanguages() const;
void SetEnabledLanguages(std::vector<std::string> const& langs);
void ClearEnabledLanguages();
bool GetIsInTryCompile() const;