summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-09-06 21:52:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-09-19 19:36:12 (GMT)
commit839c65bca032b80cfa7fe0de2ad35c2448421092 (patch)
tree89128503dafc452ce33455f6dbce08927b48be3d /Source/cmMakefileTargetGenerator.cxx
parent21b5fdf9a39f739c3566f3e77a4c5244da1b7e3a (diff)
downloadCMake-839c65bca032b80cfa7fe0de2ad35c2448421092.zip
CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.gz
CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.bz2
Convert: Move access to CurrentBinaryDirectory out of loops
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 215952a..df06dc1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -162,6 +162,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
// files for this target.
std::vector<cmSourceFile const*> customCommands;
this->GeneratorTarget->GetCustomCommands(customCommands, config);
+ std::string currentBinDir =
+ this->LocalGenerator->GetCurrentBinaryDirectory();
for (std::vector<cmSourceFile const*>::const_iterator si =
customCommands.begin();
si != customCommands.end(); ++si) {
@@ -172,8 +174,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
const std::vector<std::string>& outputs = ccg.GetOutputs();
for (std::vector<std::string>::const_iterator o = outputs.begin();
o != outputs.end(); ++o) {
- this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
- this->LocalGenerator->GetCurrentBinaryDirectory(), *o));
+ this->CleanFiles.push_back(
+ this->LocalGenerator->ConvertToRelativePath(currentBinDir, *o));
}
}
}
@@ -1180,11 +1182,12 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
<< this->GeneratorTarget->GetName() << "\n"
<< variableNameExternal << " =";
/* clang-format on */
+ std::string currentBinDir =
+ this->LocalGenerator->GetCurrentBinaryDirectory();
for (std::vector<std::string>::const_iterator i =
this->ExternalObjects.begin();
i != this->ExternalObjects.end(); ++i) {
- object = this->LocalGenerator->ConvertToRelativePath(
- this->LocalGenerator->GetCurrentBinaryDirectory(), *i);
+ object = this->LocalGenerator->ConvertToRelativePath(currentBinDir, *i);
*this->BuildFileStream << " " << lineContinue << "\n"
<< this->Makefile->GetSafeDefinition(
"CMAKE_OBJECT_NAME");