BUG: Do not perform pre-build, pre-link, or post-install commands when relinking.

This commit is contained in:
Brad King 2006-02-16 15:39:19 -05:00
parent ad2cc1f333
commit 43df79d9fc
1 changed files with 15 additions and 8 deletions

View File

@ -236,11 +236,15 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->Makefile->GetHomeOutputDirectory()); this->Makefile->GetHomeOutputDirectory());
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();
// Add the pre-build and pre-link rules.
this->LocalGenerator-> // Add the pre-build and pre-link rules building but not when relinking.
AppendCustomCommands(commands, this->Target->GetPreBuildCommands()); if(!relink)
this->LocalGenerator-> {
AppendCustomCommands(commands, this->Target->GetPreLinkCommands()); this->LocalGenerator
->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
this->LocalGenerator
->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
}
// Construct the main link rule. // Construct the main link rule.
std::string linkRuleVar = "CMAKE_"; std::string linkRuleVar = "CMAKE_";
@ -265,9 +269,12 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
commands.push_back(symlink); commands.push_back(symlink);
} }
// Add the post-build rules. // Add the post-build rules when building but not when relinking.
this->LocalGenerator->AppendCustomCommands if(!relink)
(commands, this->Target->GetPostBuildCommands()); {
this->LocalGenerator->
AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
}
// Collect up flags to link in needed libraries. // Collect up flags to link in needed libraries.
cmOStringStream linklibs; cmOStringStream linklibs;