summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:34:49 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:25:12 (GMT)
commit315b9a31895ca6bb26eba12bff3a0fe9cd37568a (patch)
tree3bfac71e8b05862cac7e6b62f6856a6b1edc5ea0 /Source
parentd5feb5b34cd9f595bf42aa934738b918785e3e87 (diff)
downloadCMake-315b9a31895ca6bb26eba12bff3a0fe9cd37568a.zip
CMake-315b9a31895ca6bb26eba12bff3a0fe9cd37568a.tar.gz
CMake-315b9a31895ca6bb26eba12bff3a0fe9cd37568a.tar.bz2
cmLocalGenerator: Merge loops which populate mapping
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3957641..3543019 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -733,6 +733,18 @@ std::string cmLocalGenerator::ExpandRuleVariable(
this->Makefile->GetSafeDefinition(compilerOptionExternalToolchain);
variableMappings[compilerOptionSysroot] =
this->Makefile->GetSafeDefinition(compilerOptionSysroot);
+
+ for (const char* const* replaceIter = cmArrayBegin(ruleReplaceVars);
+ replaceIter != cmArrayEnd(ruleReplaceVars); ++replaceIter) {
+ std::string const& lang = *i;
+ std::string actualReplace = *replaceIter;
+ if (actualReplace.find("${LANG}") != actualReplace.npos) {
+ cmSystemTools::ReplaceString(actualReplace, "${LANG}", lang);
+ }
+
+ variableMappings[actualReplace] =
+ this->Makefile->GetSafeDefinition(actualReplace);
+ }
}
std::map<std::string, std::string>::iterator compIt =
@@ -781,20 +793,6 @@ std::string cmLocalGenerator::ExpandRuleVariable(
return ret;
}
- for (const char* const* replaceIter = cmArrayBegin(ruleReplaceVars);
- replaceIter != cmArrayEnd(ruleReplaceVars); ++replaceIter) {
- for (std::vector<std::string>::iterator i = enabledLanguages.begin();
- i != enabledLanguages.end(); ++i) {
- std::string const& lang = *i;
- std::string actualReplace = *replaceIter;
- if (actualReplace.find("${LANG}") != actualReplace.npos) {
- cmSystemTools::ReplaceString(actualReplace, "${LANG}", lang);
- }
-
- variableMappings[actualReplace] =
- this->Makefile->GetSafeDefinition(actualReplace);
- }
- }
std::map<std::string, std::string>::iterator mapIt =
variableMappings.find(variable);
if (mapIt != variableMappings.end()) {