Ninja: Add a convenient 'clean' target.
It has been asked on the mailing list: http://public.kitware.com/pipermail/cmake-developers/2012-April/003805.html
This commit is contained in:
parent
ad5c9d06c4
commit
3bd41f2eb5
|
@ -754,6 +754,7 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
|
|||
|
||||
this->WriteTargetAll(os);
|
||||
this->WriteTargetRebuildManifest(os);
|
||||
this->WriteTargetClean(os);
|
||||
}
|
||||
|
||||
void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os)
|
||||
|
@ -820,3 +821,23 @@ 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());
|
||||
}
|
||||
|
|
|
@ -273,6 +273,7 @@ private:
|
|||
void WriteBuiltinTargets(std::ostream& os);
|
||||
void WriteTargetAll(std::ostream& os);
|
||||
void WriteTargetRebuildManifest(std::ostream& os);
|
||||
void WriteTargetClean(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