Ninja: Add 'restat' parameter to custom command generation method

Pass 'true' from all call sites to preserve existing behavior.
This commit is contained in:
Brad King 2015-11-19 15:09:40 -05:00
parent 866c75dedd
commit 7d64a0598d
4 changed files with 9 additions and 1 deletions

View File

@ -284,6 +284,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
const std::string& description,
const std::string& comment,
bool uses_terminal,
bool restat,
const cmNinjaDeps& outputs,
const cmNinjaDeps& deps,
const cmNinjaDeps& orderOnly)
@ -300,7 +301,10 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
cmNinjaVars vars;
vars["COMMAND"] = cmd;
vars["DESC"] = EncodeLiteral(description);
if (restat)
{
vars["restat"] = "1";
}
if (uses_terminal && SupportsConsolePool())
{
vars["pool"] = "console";
@ -924,6 +928,7 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
"Assume dependencies for generated source file.",
/*uses_terminal*/false,
/*restat*/true,
cmNinjaDeps(1, i->first), deps);
}
}

View File

@ -112,6 +112,7 @@ public:
const std::string& description,
const std::string& comment,
bool uses_terminal,
bool restat,
const cmNinjaDeps& outputs,
const cmNinjaDeps& deps = cmNinjaDeps(),
const cmNinjaDeps& orderOnly = cmNinjaDeps());

View File

@ -434,6 +434,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
this->ConstructComment(ccg),
"Custom command for " + ninjaOutputs[0],
cc->GetUsesTerminal(),
/*restat*/true,
ninjaOutputs,
ninjaDeps,
orderOnlyDeps);

View File

@ -131,6 +131,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
desc,
"Utility command for " + this->GetTargetName(),
uses_terminal,
/*restat*/true,
util_outputs,
deps);