diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-11 12:16:39 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-13 18:19:58 (GMT) |
commit | 74de9a734c92288fb3e602be0d1c967b33b67443 (patch) | |
tree | 76c1c7478d0741e8574a5065b3afd912b111c150 /Source/cmState.cxx | |
parent | b159bff732d4e34a683edd1740604428049d1819 (diff) | |
download | CMake-74de9a734c92288fb3e602be0d1c967b33b67443.zip CMake-74de9a734c92288fb3e602be0d1c967b33b67443.tar.gz CMake-74de9a734c92288fb3e602be0d1c967b33b67443.tar.bz2 |
cmGlobalGenerator: Delegate storage of enabled languages to cmState.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 3e88ecc..c43262f 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -236,3 +236,30 @@ bool cmState::IsPropertyChained(const std::string& name, { return this->PropertyDefinitions[scope].IsPropertyChained(name); } + +void cmState::SetLanguageEnabled(std::string const& l) +{ + std::vector<std::string>::iterator it = + std::lower_bound(this->EnabledLanguages.begin(), + this->EnabledLanguages.end(), l); + if (it == this->EnabledLanguages.end() || *it != l) + { + this->EnabledLanguages.insert(it, l); + } +} + +bool cmState::GetLanguageEnabled(std::string const& l) const +{ + return std::binary_search(this->EnabledLanguages.begin(), + this->EnabledLanguages.end(), l); +} + +std::vector<std::string> cmState::GetEnabledLanguages() const +{ + return this->EnabledLanguages; +} + +void cmState::ClearEnabledLanguages() +{ + this->EnabledLanguages.clear(); +} |