diff options
author | friendlyanon <friendlyanon_@hotmail.com> | 2022-06-30 18:27:42 (GMT) |
---|---|---|
committer | friendlyanon <friendlyanon_@hotmail.com> | 2022-06-30 19:21:17 (GMT) |
commit | 66bfe14309e9e8968a159d1eda7ed00322d5559d (patch) | |
tree | 400e1d0d0a07b96a7c7622e4b6824815b2207770 | |
parent | 7375542615e0c1d3d09117eac3a9e201275da425 (diff) | |
download | CMake-66bfe14309e9e8968a159d1eda7ed00322d5559d.zip CMake-66bfe14309e9e8968a159d1eda7ed00322d5559d.tar.gz CMake-66bfe14309e9e8968a159d1eda7ed00322d5559d.tar.bz2 |
cmMakefile: Refactor parameter and variable names for EnableLanguage
In commit 731369ef9c (ENH: try to initialize all languages at the same
time, 2004-08-27, v2.4.0~2899) the languages parameter name for
cmMakefile::EnableLanguage() was changed to "std::vector languages" in
the declaration, however the definition had "std::vector lang".
Furthermore, the variable names in the definition had confusing names,
such as the "i" variable in the loop which referred to an iterator at
one point, but no longer does.
-rw-r--r-- | Source/cmMakefile.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 62ea427..79a56c1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3479,7 +3479,7 @@ void cmMakefile::AddTargetObject(std::string const& tgtName, #endif } -void cmMakefile::EnableLanguage(std::vector<std::string> const& lang, +void cmMakefile::EnableLanguage(std::vector<std::string> const& languages, bool optional) { if (this->DeferRunning) { @@ -3494,21 +3494,23 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& lang, // If RC is explicitly listed we need to do it after other languages. // On some platforms we enable RC implicitly while enabling others. // Do not let that look like recursive enable_language(RC). - std::vector<std::string> langs; - std::vector<std::string> langsRC; - langs.reserve(lang.size()); - for (std::string const& i : lang) { - if (i == "RC") { - langsRC.push_back(i); + std::vector<std::string> languages_without_RC; + std::vector<std::string> languages_for_RC; + languages_without_RC.reserve(languages.size()); + for (std::string const& language : languages) { + if (language == "RC") { + languages_for_RC.push_back(language); } else { - langs.push_back(i); + languages_without_RC.push_back(language); } } - if (!langs.empty()) { - this->GetGlobalGenerator()->EnableLanguage(langs, this, optional); + if (!languages_without_RC.empty()) { + this->GetGlobalGenerator()->EnableLanguage(languages_without_RC, this, + optional); } - if (!langsRC.empty()) { - this->GetGlobalGenerator()->EnableLanguage(langsRC, this, optional); + if (!languages_for_RC.empty()) { + this->GetGlobalGenerator()->EnableLanguage(languages_for_RC, this, + optional); } } |