summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-05-17 18:58:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-05-17 18:58:31 (GMT)
commitc47f90487413703a1306cc0a0f03c05b981c2c2a (patch)
tree499984d69423f8c58bec238de551c2a4d1fa4ae4 /Source
parent851908580307f4e45976eaef562ecf00f4025e28 (diff)
parent92cee7626c5066a4af4cf66f85b0cd2c06bd9439 (diff)
downloadCMake-c47f90487413703a1306cc0a0f03c05b981c2c2a.zip
CMake-c47f90487413703a1306cc0a0f03c05b981c2c2a.tar.gz
CMake-c47f90487413703a1306cc0a0f03c05b981c2c2a.tar.bz2
Merge topic 'ninja_convenience_targets'
92cee76 Ninja: Add a convenient 'help' target. 3bd41f2 Ninja: Add a convenient 'clean' target.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx42
-rw-r--r--Source/cmGlobalNinjaGenerator.h2
2 files changed, 44 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9cbd502..67f809a 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -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());
+}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 3217581..e652972 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -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.