Commit 89f098bc authored by Brad King's avatar Brad King
Browse files

BUG: Adjust prebuild/prelink/postbuild script construction to account for...

BUG: Adjust prebuild/prelink/postbuild script construction to account for ConstructScript no longer producing trailing newlines.  This addresses bug#3977.
parent e23b82c2
......@@ -766,34 +766,33 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
// header stuff
customRuleCode += "PreLink_Cmds=";
}
const char* prelink_newline = "\\\n\t";
for (std::vector<cmCustomCommand>::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<cmCustomCommand>::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)
{
......
......@@ -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(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment