Ninja: Add 'restat' parameter to custom command generation method
Pass 'true' from all call sites to preserve existing behavior.
This commit is contained in:
parent
866c75dedd
commit
7d64a0598d
|
@ -284,6 +284,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
|
||||||
const std::string& description,
|
const std::string& description,
|
||||||
const std::string& comment,
|
const std::string& comment,
|
||||||
bool uses_terminal,
|
bool uses_terminal,
|
||||||
|
bool restat,
|
||||||
const cmNinjaDeps& outputs,
|
const cmNinjaDeps& outputs,
|
||||||
const cmNinjaDeps& deps,
|
const cmNinjaDeps& deps,
|
||||||
const cmNinjaDeps& orderOnly)
|
const cmNinjaDeps& orderOnly)
|
||||||
|
@ -300,7 +301,10 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
|
||||||
cmNinjaVars vars;
|
cmNinjaVars vars;
|
||||||
vars["COMMAND"] = cmd;
|
vars["COMMAND"] = cmd;
|
||||||
vars["DESC"] = EncodeLiteral(description);
|
vars["DESC"] = EncodeLiteral(description);
|
||||||
vars["restat"] = "1";
|
if (restat)
|
||||||
|
{
|
||||||
|
vars["restat"] = "1";
|
||||||
|
}
|
||||||
if (uses_terminal && SupportsConsolePool())
|
if (uses_terminal && SupportsConsolePool())
|
||||||
{
|
{
|
||||||
vars["pool"] = "console";
|
vars["pool"] = "console";
|
||||||
|
@ -924,6 +928,7 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
|
||||||
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
||||||
"Assume dependencies for generated source file.",
|
"Assume dependencies for generated source file.",
|
||||||
/*uses_terminal*/false,
|
/*uses_terminal*/false,
|
||||||
|
/*restat*/true,
|
||||||
cmNinjaDeps(1, i->first), deps);
|
cmNinjaDeps(1, i->first), deps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
const std::string& description,
|
const std::string& description,
|
||||||
const std::string& comment,
|
const std::string& comment,
|
||||||
bool uses_terminal,
|
bool uses_terminal,
|
||||||
|
bool restat,
|
||||||
const cmNinjaDeps& outputs,
|
const cmNinjaDeps& outputs,
|
||||||
const cmNinjaDeps& deps = cmNinjaDeps(),
|
const cmNinjaDeps& deps = cmNinjaDeps(),
|
||||||
const cmNinjaDeps& orderOnly = cmNinjaDeps());
|
const cmNinjaDeps& orderOnly = cmNinjaDeps());
|
||||||
|
|
|
@ -434,6 +434,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
|
||||||
this->ConstructComment(ccg),
|
this->ConstructComment(ccg),
|
||||||
"Custom command for " + ninjaOutputs[0],
|
"Custom command for " + ninjaOutputs[0],
|
||||||
cc->GetUsesTerminal(),
|
cc->GetUsesTerminal(),
|
||||||
|
/*restat*/true,
|
||||||
ninjaOutputs,
|
ninjaOutputs,
|
||||||
ninjaDeps,
|
ninjaDeps,
|
||||||
orderOnlyDeps);
|
orderOnlyDeps);
|
||||||
|
|
|
@ -131,6 +131,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
|
||||||
desc,
|
desc,
|
||||||
"Utility command for " + this->GetTargetName(),
|
"Utility command for " + this->GetTargetName(),
|
||||||
uses_terminal,
|
uses_terminal,
|
||||||
|
/*restat*/true,
|
||||||
util_outputs,
|
util_outputs,
|
||||||
deps);
|
deps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue