Commit 7d64a059 authored by Brad King's avatar Brad King

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

Pass 'true' from all call sites to preserve existing behavior.
parent 866c75de
......@@ -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);
vars["restat"] = "1";
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);
}
}
......
......@@ -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());
......
......@@ -434,6 +434,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
this->ConstructComment(ccg),
"Custom command for " + ninjaOutputs[0],
cc->GetUsesTerminal(),
/*restat*/true,
ninjaOutputs,
ninjaDeps,
orderOnlyDeps);
......
......@@ -131,6 +131,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
desc,
"Utility command for " + this->GetTargetName(),
uses_terminal,
/*restat*/true,
util_outputs,
deps);
......
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