From d59913f001b6eb74f9baf8bad183dc83d5e7bcd1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 18 Jan 2015 15:59:03 +0100 Subject: Take computation out of loop. --- Source/cmLocalUnixMakefileGenerator3.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index fbf2140..13c47c5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2393,11 +2393,13 @@ void cmLocalUnixMakefileGenerator3 // On UNIX we must construct a single shell command to change // directory and build because make resets the directory between // each command. + std::string outputForExisting = + this->ConvertToOutputForExisting(tgtDir, relRetDir); std::vector::iterator i = commands.begin(); for (; i != commands.end(); ++i) { std::string cmd = cd_cmd; - cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir); + cmd += outputForExisting; cmd += " && "; cmd += *i; *i = cmd; -- cgit v0.12