diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2012-04-19 14:47:48 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-05-09 17:08:12 (GMT) |
commit | 3bd41f2eb564d891c95e3ead5e72656b7daa3ff1 (patch) | |
tree | a43dede3157bc7822e8daf61948e85a80a5b804f | |
parent | ad5c9d06c48b566fa6b1bb885142003c8ac9de60 (diff) | |
download | CMake-3bd41f2eb564d891c95e3ead5e72656b7daa3ff1.zip CMake-3bd41f2eb564d891c95e3ead5e72656b7daa3ff1.tar.gz CMake-3bd41f2eb564d891c95e3ead5e72656b7daa3ff1.tar.bz2 |
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
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 21 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 9cbd502..ee3842d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -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()); +} diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 3217581..32edfaa 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -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. |