$OpenBSD: patch-Source_cmGlobalNinjaGenerator_cxx,v 1.2 2014/12/31 11:06:02 dcoppa Exp $

Use Ninja-1.5's console pool to have visible output during long-running
tasks which produce status updates on the console (such as test suites)

--- Source/cmGlobalNinjaGenerator.cxx.orig	Mon Dec 15 14:07:43 2014
+++ Source/cmGlobalNinjaGenerator.cxx	Thu Dec 18 05:37:12 2014
@@ -238,6 +238,7 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule()
                 "$COMMAND",
                 "$DESC",
                 "Rule for running custom commands.",
+                /*pool*/ "console",
                 /*depfile*/ "",
                 /*deptype*/ "",
                 /*rspfile*/ "",
@@ -300,6 +301,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule()
                 cmd.str(),
                 "Copying OS X Content $out",
                 "Rule for copying OS X bundle content file.",
+                /*pool*/ "",
                 /*depfile*/ "",
                 /*deptype*/ "",
                 /*rspfile*/ "",
@@ -335,6 +337,7 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& o
                                        const std::string& command,
                                        const std::string& description,
                                        const std::string& comment,
+                                       const std::string& pool,
                                        const std::string& depfile,
                                        const std::string& deptype,
                                        const std::string& rspfile,
@@ -365,6 +368,13 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& o
   // Write the rule.
   os << "rule " << name << "\n";
 
+  // Write the pool if any.
+  if(!pool.empty())
+    {
+    cmGlobalNinjaGenerator::Indent(os, 1);
+    os << "pool = " << pool << "\n";
+    }
+
   // Write the depfile if any.
   if(!depfile.empty())
     {
@@ -598,6 +608,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string
                                      const std::string& command,
                                      const std::string& description,
                                      const std::string& comment,
+                                     const std::string& pool,
                                      const std::string& depfile,
                                      const std::string& deptype,
                                      const std::string& rspfile,
@@ -617,6 +628,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string
                                     command,
                                     description,
                                     comment,
+                                    pool,
                                     depfile,
                                     deptype,
                                     rspfile,
@@ -1112,6 +1124,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifes
             cmd.str(),
             "Re-running CMake...",
             "Rule for re-running cmake.",
+            /*pool=*/ "",
             /*depfile=*/ "",
             /*deptype=*/ "",
             /*rspfile=*/ "",
@@ -1192,6 +1205,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ost
             ninjaCmd() + " -t clean",
             "Cleaning all built files...",
             "Rule for cleaning all built files.",
+            /*pool=*/ "",
             /*depfile=*/ "",
             /*deptype=*/ "",
             /*rspfile=*/ "",
@@ -1215,6 +1229,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostr
             ninjaCmd() + " -t targets",
             "All primary targets available:",
             "Rule for printing all primary targets available.",
+            /*pool=*/ "",
             /*depfile=*/ "",
             /*deptype=*/ "",
             /*rspfile=*/ "",
