Merge topic 'ninja_convenience_targets'
92cee76
Ninja: Add a convenient 'help' target.3bd41f2
Ninja: Add a convenient 'clean' target.
This commit is contained in:
commit
c47f904874
|
@ -754,6 +754,8 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
|
|||
|
||||
this->WriteTargetAll(os);
|
||||
this->WriteTargetRebuildManifest(os);
|
||||
this->WriteTargetClean(os);
|
||||
this->WriteTargetHelp(os);
|
||||
}
|
||||
|
||||
void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os)
|
||||
|
@ -820,3 +822,43 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
|||
implicitDeps,
|
||||
cmNinjaDeps());
|
||||
}
|
||||
|
||||
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
|
||||
{
|
||||
WriteRule(*this->RulesFileStream,
|
||||
"CLEAN",
|
||||
"ninja -t clean",
|
||||
"Cleaning all built files...",
|
||||
"Rule for cleaning all built files.",
|
||||
/*depfile=*/ "",
|
||||
/*restat=*/ false,
|
||||
/*generator=*/ false);
|
||||
WriteBuild(os,
|
||||
"Clean all the built files.",
|
||||
"CLEAN",
|
||||
/*outputs=*/ cmNinjaDeps(1, "clean"),
|
||||
/*explicitDeps=*/ cmNinjaDeps(),
|
||||
/*implicitDeps=*/ cmNinjaDeps(),
|
||||
/*orderOnlyDeps=*/ cmNinjaDeps(),
|
||||
/*variables=*/ cmNinjaVars());
|
||||
}
|
||||
|
||||
void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
|
||||
{
|
||||
WriteRule(*this->RulesFileStream,
|
||||
"HELP",
|
||||
"ninja -t targets",
|
||||
"All primary targets available:",
|
||||
"Rule for printing all primary targets available.",
|
||||
/*depfile=*/ "",
|
||||
/*restat=*/ false,
|
||||
/*generator=*/ false);
|
||||
WriteBuild(os,
|
||||
"Print all primary targets available.",
|
||||
"HELP",
|
||||
/*outputs=*/ cmNinjaDeps(1, "help"),
|
||||
/*explicitDeps=*/ cmNinjaDeps(),
|
||||
/*implicitDeps=*/ cmNinjaDeps(),
|
||||
/*orderOnlyDeps=*/ cmNinjaDeps(),
|
||||
/*variables=*/ cmNinjaVars());
|
||||
}
|
||||
|
|
|
@ -273,6 +273,8 @@ private:
|
|||
void WriteBuiltinTargets(std::ostream& os);
|
||||
void WriteTargetAll(std::ostream& os);
|
||||
void WriteTargetRebuildManifest(std::ostream& os);
|
||||
void WriteTargetClean(std::ostream& os);
|
||||
void WriteTargetHelp(std::ostream& os);
|
||||
|
||||
/// Called when we have seen the given custom command. Returns true
|
||||
/// if we has seen it before.
|
||||
|
|
Loading…
Reference in New Issue