ENH: Give target in which custom commands build
This gives the cmTarget instance for which custom command rules are being generated to cmLocalUnixMakefileGenerator3::AppendCustomCommands. It will be useful in the future.
This commit is contained in:
parent
13f9bb646d
commit
c895d9f2e0
@ -954,12 +954,13 @@ void
|
|||||||
cmLocalUnixMakefileGenerator3
|
cmLocalUnixMakefileGenerator3
|
||||||
::AppendCustomCommands(std::vector<std::string>& commands,
|
::AppendCustomCommands(std::vector<std::string>& commands,
|
||||||
const std::vector<cmCustomCommand>& ccs,
|
const std::vector<cmCustomCommand>& ccs,
|
||||||
|
cmTarget* target,
|
||||||
cmLocalGenerator::RelativeRoot relative)
|
cmLocalGenerator::RelativeRoot relative)
|
||||||
{
|
{
|
||||||
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
||||||
i != ccs.end(); ++i)
|
i != ccs.end(); ++i)
|
||||||
{
|
{
|
||||||
this->AppendCustomCommand(commands, *i, true, relative);
|
this->AppendCustomCommand(commands, *i, target, true, relative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -967,10 +968,13 @@ cmLocalUnixMakefileGenerator3
|
|||||||
void
|
void
|
||||||
cmLocalUnixMakefileGenerator3
|
cmLocalUnixMakefileGenerator3
|
||||||
::AppendCustomCommand(std::vector<std::string>& commands,
|
::AppendCustomCommand(std::vector<std::string>& commands,
|
||||||
const cmCustomCommand& cc, bool echo_comment,
|
const cmCustomCommand& cc,
|
||||||
|
cmTarget* target,
|
||||||
|
bool echo_comment,
|
||||||
cmLocalGenerator::RelativeRoot relative,
|
cmLocalGenerator::RelativeRoot relative,
|
||||||
std::ostream* content)
|
std::ostream* content)
|
||||||
{
|
{
|
||||||
|
static_cast<void>(target); // Future use
|
||||||
// Optionally create a command to display the custom command's
|
// Optionally create a command to display the custom command's
|
||||||
// comment text. This is used for pre-build, pre-link, and
|
// comment text. This is used for pre-build, pre-link, and
|
||||||
// post-build command comments. Custom build step commands have
|
// post-build command comments. Custom build step commands have
|
||||||
@ -1621,9 +1625,11 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
glIt->second.GetPostBuildCommands());
|
glIt->second.GetPostBuildCommands());
|
||||||
this->AppendCustomCommands(commands,
|
this->AppendCustomCommands(commands,
|
||||||
glIt->second.GetPreBuildCommands(),
|
glIt->second.GetPreBuildCommands(),
|
||||||
|
&glIt->second,
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
this->AppendCustomCommands(commands,
|
this->AppendCustomCommands(commands,
|
||||||
glIt->second.GetPostBuildCommands(),
|
glIt->second.GetPostBuildCommands(),
|
||||||
|
&glIt->second,
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
std::string targetName = glIt->second.GetName();
|
std::string targetName = glIt->second.GetName();
|
||||||
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
||||||
|
@ -326,10 +326,12 @@ protected:
|
|||||||
const cmCustomCommand& cc);
|
const cmCustomCommand& cc);
|
||||||
void AppendCustomCommands(std::vector<std::string>& commands,
|
void AppendCustomCommands(std::vector<std::string>& commands,
|
||||||
const std::vector<cmCustomCommand>& ccs,
|
const std::vector<cmCustomCommand>& ccs,
|
||||||
|
cmTarget* target,
|
||||||
cmLocalGenerator::RelativeRoot relative =
|
cmLocalGenerator::RelativeRoot relative =
|
||||||
cmLocalGenerator::HOME_OUTPUT);
|
cmLocalGenerator::HOME_OUTPUT);
|
||||||
void AppendCustomCommand(std::vector<std::string>& commands,
|
void AppendCustomCommand(std::vector<std::string>& commands,
|
||||||
const cmCustomCommand& cc,
|
const cmCustomCommand& cc,
|
||||||
|
cmTarget* target,
|
||||||
bool echo_comment=false,
|
bool echo_comment=false,
|
||||||
cmLocalGenerator::RelativeRoot relative =
|
cmLocalGenerator::RelativeRoot relative =
|
||||||
cmLocalGenerator::HOME_OUTPUT,
|
cmLocalGenerator::HOME_OUTPUT,
|
||||||
|
@ -299,9 +299,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
if(!relink)
|
if(!relink)
|
||||||
{
|
{
|
||||||
this->LocalGenerator
|
this->LocalGenerator
|
||||||
->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
|
->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
|
||||||
|
this->Target);
|
||||||
this->LocalGenerator
|
this->LocalGenerator
|
||||||
->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
|
->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
|
||||||
|
this->Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether a link script will be used.
|
// Determine whether a link script will be used.
|
||||||
@ -436,7 +438,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
|||||||
if(!relink)
|
if(!relink)
|
||||||
{
|
{
|
||||||
this->LocalGenerator->
|
this->LocalGenerator->
|
||||||
AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
|
AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
|
||||||
|
this->Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the build rule.
|
// Write the build rule.
|
||||||
|
@ -600,9 +600,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||||||
if(!relink)
|
if(!relink)
|
||||||
{
|
{
|
||||||
this->LocalGenerator
|
this->LocalGenerator
|
||||||
->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
|
->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
|
||||||
|
this->Target);
|
||||||
this->LocalGenerator
|
this->LocalGenerator
|
||||||
->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
|
->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
|
||||||
|
this->Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether a link script will be used.
|
// Determine whether a link script will be used.
|
||||||
@ -867,7 +869,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||||||
if(!relink)
|
if(!relink)
|
||||||
{
|
{
|
||||||
this->LocalGenerator->
|
this->LocalGenerator->
|
||||||
AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
|
AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
|
||||||
|
this->Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the build rule.
|
// Write the build rule.
|
||||||
|
@ -1125,7 +1125,7 @@ void cmMakefileTargetGenerator
|
|||||||
|
|
||||||
// Now append the actual user-specified commands.
|
// Now append the actual user-specified commands.
|
||||||
cmOStringStream content;
|
cmOStringStream content;
|
||||||
this->LocalGenerator->AppendCustomCommand(commands, cc, false,
|
this->LocalGenerator->AppendCustomCommand(commands, cc, this->Target, false,
|
||||||
cmLocalGenerator::HOME_OUTPUT,
|
cmLocalGenerator::HOME_OUTPUT,
|
||||||
&content);
|
&content);
|
||||||
|
|
||||||
|
@ -54,13 +54,13 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
|
|||||||
(depends, this->Target->GetPostBuildCommands());
|
(depends, this->Target->GetPostBuildCommands());
|
||||||
|
|
||||||
this->LocalGenerator->AppendCustomCommands
|
this->LocalGenerator->AppendCustomCommands
|
||||||
(commands, this->Target->GetPreBuildCommands());
|
(commands, this->Target->GetPreBuildCommands(), this->Target);
|
||||||
|
|
||||||
// Depend on all custom command outputs for sources
|
// Depend on all custom command outputs for sources
|
||||||
this->DriveCustomCommands(depends);
|
this->DriveCustomCommands(depends);
|
||||||
|
|
||||||
this->LocalGenerator->AppendCustomCommands
|
this->LocalGenerator->AppendCustomCommands
|
||||||
(commands, this->Target->GetPostBuildCommands());
|
(commands, this->Target->GetPostBuildCommands(), this->Target);
|
||||||
|
|
||||||
// Add dependencies on targets that must be built first.
|
// Add dependencies on targets that must be built first.
|
||||||
this->AppendTargetDepends(depends);
|
this->AppendTargetDepends(depends);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user