From 89f098bc59a41fa1a3387c493f97705242315311 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 25 Oct 2006 12:49:27 -0400 Subject: BUG: Adjust prebuild/prelink/postbuild script construction to account for ConstructScript no longer producing trailing newlines. This addresses bug#3977. --- Source/cmLocalVisualStudio6Generator.cxx | 19 +++++++++---------- Source/cmLocalVisualStudio7Generator.cxx | 12 ++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index a24b14b..0c6abd2 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -766,34 +766,33 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, // header stuff customRuleCode += "PreLink_Cmds="; } - const char* prelink_newline = "\\\n\t"; for (std::vector::const_iterator cr = target.GetPreBuildCommands().begin(); cr != target.GetPreBuildCommands().end(); ++cr) { - if(++prelink_count == prelink_total) + if(prelink_count++ > 0) { - prelink_newline = ""; + customRuleCode += "\\\n\t"; } customRuleCode += this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars(), - prelink_newline); + "\\\n\t"); } for (std::vector::const_iterator cr = target.GetPreLinkCommands().begin(); cr != target.GetPreLinkCommands().end(); ++cr) { - if(++prelink_count == prelink_total) + if(prelink_count++ > 0) { - prelink_newline = ""; + customRuleCode += "\\\n\t"; } customRuleCode += this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars(), - prelink_newline); + "\\\n\t"); } if(prelink_total > 0) { @@ -814,15 +813,15 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, target.GetPostBuildCommands().begin(); cr != target.GetPostBuildCommands().end(); ++cr) { - if(++postbuild_count == postbuild_total) + if(postbuild_count++ > 0) { - postbuild_newline = ""; + customRuleCode += "\\\n\t"; } customRuleCode += this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), cr->GetEscapeOldStyle(), cr->GetEscapeAllowMakeVars(), - postbuild_newline); + "\\\n\t"); } if(postbuild_total > 0) { diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 262d92e..b650157 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1438,6 +1438,10 @@ void cmLocalVisualStudio7Generator fout << "\nCommandLine=\""; init = true; } + else + { + fout << "\n"; + } std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), @@ -1463,6 +1467,10 @@ void cmLocalVisualStudio7Generator fout << "\nCommandLine=\""; init = true; } + else + { + fout << "\n"; + } std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), @@ -1488,6 +1496,10 @@ void cmLocalVisualStudio7Generator fout << "\nCommandLine=\""; init = true; } + else + { + fout << "\n"; + } std::string script = this->ConstructScript(cr->GetCommandLines(), cr->GetWorkingDirectory(), -- cgit v0.12