Merge topic 'ninja_convenience_targets'

92cee76 Ninja: Add a convenient 'help' target.
3bd41f2 Ninja: Add a convenient 'clean' target.
This commit is contained in:
David Cole 2012-05-17 14:58:31 -04:00 committed by CMake Topic Stage
commit c47f904874
2 changed files with 44 additions and 0 deletions

View File

@ -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());
}

View File

@ -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.