summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2012-04-19 14:47:48 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-05-09 17:08:12 (GMT)
commit3bd41f2eb564d891c95e3ead5e72656b7daa3ff1 (patch)
treea43dede3157bc7822e8daf61948e85a80a5b804f /Source/cmGlobalNinjaGenerator.cxx
parentad5c9d06c48b566fa6b1bb885142003c8ac9de60 (diff)
downloadCMake-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
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx21
1 files changed, 21 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());
+}