From 4d69ac7697929a12e0be1273dfc627ec56fe7acd Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Sep 2016 23:31:04 +0200 Subject: Convert: Move access to BinaryDirectory out of loops --- Source/cmDependsFortran.cxx | 6 ++---- Source/cmMakefileTargetGenerator.cxx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 9fb4221..ba0617f 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -429,16 +429,14 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, modFile += "/"; modFile += *i; modFile = this->LocalGenerator->ConvertToOutputFormat( - this->LocalGenerator->ConvertToRelativePath( - this->LocalGenerator->GetBinaryDirectory(), modFile), + this->LocalGenerator->ConvertToRelativePath(binDir, modFile), cmOutputConverter::SHELL); std::string stampFile = stamp_dir; stampFile += "/"; stampFile += m; stampFile += ".mod.stamp"; stampFile = this->LocalGenerator->ConvertToOutputFormat( - this->LocalGenerator->ConvertToRelativePath( - this->LocalGenerator->GetBinaryDirectory(), stampFile), + this->LocalGenerator->ConvertToRelativePath(binDir, stampFile), cmOutputConverter::SHELL); makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile << " " << stampFile; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cdf4330..5f39a85 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -900,13 +900,13 @@ bool cmMakefileTargetGenerator::WriteMakeRule( // For multiple outputs, make the extra ones depend on the first one. std::vector const output_depends(1, outputs[0]); + std::string binDir = this->LocalGenerator->GetBinaryDirectory(); for (std::vector::const_iterator o = outputs.begin() + 1; o != outputs.end(); ++o) { // Touch the extra output so "make" knows that it was updated, // but only if the output was acually created. std::string const out = this->LocalGenerator->ConvertToOutputFormat( - this->LocalGenerator->ConvertToRelativePath( - this->LocalGenerator->GetBinaryDirectory(), *o), + this->LocalGenerator->ConvertToRelativePath(binDir, *o), cmOutputConverter::SHELL); std::vector output_commands; -- cgit v0.12