[Cmake-commits] CMake branch, next, updated. v2.8.8-3119-ged157fc

Brad King brad.king at kitware.com
Tue Jun 12 15:44:53 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ed157fcd3830ac139ec8983e4f72fe60aab7cce8 (commit)
       via  32313fd0d44fbd14b111a7eefdb3ceac3fa727ff (commit)
       via  94de98290230e010a28fcbf36c0f691b564fbc5c (commit)
      from  9ee3fd68e754d396c99f732714efa7ed1bbe845a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed157fcd3830ac139ec8983e4f72fe60aab7cce8
commit ed157fcd3830ac139ec8983e4f72fe60aab7cce8
Merge: 9ee3fd6 32313fd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 12 15:44:52 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 12 15:44:52 2012 -0400

    Merge topic 'no-std-stringstream' into next
    
    32313fd Merge branch 'ninja-rspfile' into no-std-stringstream
    94de982 Avoid direct use of std::(o|)stringstream (#13272)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32313fd0d44fbd14b111a7eefdb3ceac3fa727ff
commit 32313fd0d44fbd14b111a7eefdb3ceac3fa727ff
Merge: 94de982 e3a1f72
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 6 15:26:48 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 12 15:43:32 2012 -0400

    Merge branch 'ninja-rspfile' into no-std-stringstream
    
    Conflicts:
    	Source/cmGlobalNinjaGenerator.cxx
    	Source/cmLocalNinjaGenerator.cxx
    	Source/cmNinjaNormalTargetGenerator.cxx

diff --cc Source/cmGlobalNinjaGenerator.cxx
index 40348e6,c4b1cc9..4d986ef
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@@ -123,7 -127,7 +127,7 @@@ void cmGlobalNinjaGenerator::WriteBuild
  
    cmGlobalNinjaGenerator::WriteComment(os, comment);
  
-   cmOStringStream builds;
 -  std::stringstream arguments;
++  cmOStringStream arguments;
  
    // TODO: Better formatting for when there are multiple input/output files.
  
@@@ -161,12 -154,32 +154,32 @@@
      for(cmNinjaDeps::const_iterator i = orderOnlyDeps.begin();
          i != orderOnlyDeps.end();
          ++i)
-       builds  << " " << EncodeIdent(EncodePath(*i), os);
+       arguments  << " " << EncodeIdent(EncodePath(*i), os);
      }
  
-   builds << "\n";
+   arguments << "\n";
+ 
+ 
 -  std::ostringstream builds;
++  cmOStringStream builds;
+ 
+   // Write outputs files.
+   builds << "build";
+   for(cmNinjaDeps::const_iterator i = outputs.begin();
+       i != outputs.end();
+       ++i)
+     builds << " " << EncodeIdent(EncodePath(*i), os);
+   builds << ":";
+ 
  
-   os << builds.str();
+   // Write the rule.
+   builds << " " << rule;
+ 
+   // check if a response file rule should be used
+   const std::string args = arguments.str();
+   if (cmdLineLimit > 0 && args.size() > (size_t)cmdLineLimit)
+     builds << "_RSPFILE";
+ 
+   os << builds.str() << args;
  
    // Write the variables bound to this build statement.
    for(cmNinjaVars::const_iterator i = variables.begin();
diff --cc Source/cmLocalNinjaGenerator.cxx
index f6a6bc2,a0141cf..d5baaee
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@@ -275,16 -275,16 +275,16 @@@ std::string cmLocalNinjaGenerator::Buil
      return ":";
  #endif
  
-   // TODO: This will work only on Unix platforms. I don't
-   // want to use a link.txt file because I will lose the benefit of the
-   // $in variables. A discussion about dealing with multiple commands in
-   // a rule is started here:
-   // groups.google.com/group/ninja-build/browse_thread/thread/d515f23a78986008
 -  std::ostringstream cmd;
 +  cmOStringStream cmd;
    for (std::vector<std::string>::const_iterator li = cmdLines.begin();
         li != cmdLines.end(); ++li) {
-     if (li != cmdLines.begin())
+     if (li != cmdLines.begin()) {
        cmd << " && ";
+ #ifdef _WIN32
+     } else if (cmdLines.size() > 1) {
+       cmd << "cmd.exe /c ";
+ #endif
+     }
      cmd << *li;
    }
    return cmd.str();
diff --cc Source/cmNinjaNormalTargetGenerator.cxx
index 1751091,ddf96eb..b38619a
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@@ -214,11 -239,11 +239,11 @@@ cmNinjaNormalTargetGenerato
      std::string linkCmd =
        this->GetLocalGenerator()->BuildCommandLine(linkCmds);
  
-     // Write the linker rule.
+     // Write the linker rule with response file if needed.
 -    std::ostringstream comment;
 +    cmOStringStream comment;
      comment << "Rule for linking " << this->TargetLinkLanguage << " "
              << this->GetVisibleTypeName() << ".";
 -    std::ostringstream description;
 +    cmOStringStream description;
      description << "Linking " << this->TargetLinkLanguage << " "
                  << this->GetVisibleTypeName() << " $out";
      this->GetGlobalGenerator()->AddRule(ruleName,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94de98290230e010a28fcbf36c0f691b564fbc5c
commit 94de98290230e010a28fcbf36c0f691b564fbc5c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 6 15:14:40 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 12 15:40:24 2012 -0400

    Avoid direct use of std::(o|)stringstream (#13272)
    
    Older C++ compilers do not provide a standard std::stringstream.
    Use our compatibility interfaces instead.
    
    Also avoid std::stringstream(openmode) signature.  Our approximate
    stringstream implementation provided when the standard one is not
    available does not support the openmode argument.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 0e89fab..40348e6 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -66,7 +66,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident,
   if (std::find_if(ident.begin(), ident.end(),
                    std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) {
     static unsigned VarNum = 0;
-    std::ostringstream names;
+    cmOStringStream names;
     names << "ident" << VarNum++;
     vars << names.str() << " = " << ident << "\n";
     return "$" + names.str();
@@ -123,7 +123,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
 
   cmGlobalNinjaGenerator::WriteComment(os, comment);
 
-  std::ostringstream builds;
+  cmOStringStream builds;
 
   // TODO: Better formatting for when there are multiple input/output files.
 
@@ -825,7 +825,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
   cmLocalGenerator *lg = this->LocalGenerators[0];
   cmMakefile* mfRoot = lg->GetMakefile();
 
-  std::ostringstream cmd;
+  cmOStringStream cmd;
   cmd << lg->ConvertToOutputFormat(
            mfRoot->GetRequiredDefinition("CMAKE_COMMAND"),
            cmLocalGenerator::SHELL)
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 425b219..f6a6bc2 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -280,7 +280,7 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
   // $in variables. A discussion about dealing with multiple commands in
   // a rule is started here:
   // groups.google.com/group/ninja-build/browse_thread/thread/d515f23a78986008
-  std::ostringstream cmd;
+  cmOStringStream cmd;
   for (std::vector<std::string>::const_iterator li = cmdLines.begin();
        li != cmdLines.end(); ++li) {
     if (li != cmdLines.begin())
@@ -299,7 +299,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc,
     if (!wd)
       wd = this->GetMakefile()->GetStartOutputDirectory();
 
-    std::ostringstream cdCmd;
+    cmOStringStream cdCmd;
     cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL);
     cmdLines.push_back(cdCmd.str());
   }
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 8b86a98..1751091 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -215,10 +215,10 @@ cmNinjaNormalTargetGenerator
       this->GetLocalGenerator()->BuildCommandLine(linkCmds);
 
     // Write the linker rule.
-    std::ostringstream comment;
+    cmOStringStream comment;
     comment << "Rule for linking " << this->TargetLinkLanguage << " "
             << this->GetVisibleTypeName() << ".";
-    std::ostringstream description;
+    cmOStringStream description;
     description << "Linking " << this->TargetLinkLanguage << " "
                 << this->GetVisibleTypeName() << " $out";
     this->GetGlobalGenerator()->AddRule(ruleName,
@@ -353,7 +353,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
                                    /*implib=*/true).c_str());
 
   // Compute the comment.
-  std::ostringstream comment;
+  cmOStringStream comment;
   comment << "Link the " << this->GetVisibleTypeName() << " "
           << targetOutputReal;
 
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index e419a4d..32b8f93 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -365,9 +365,9 @@ cmNinjaTargetGenerator
     this->GetLocalGenerator()->BuildCommandLine(compileCmds);
 
   // Write the rule for compiling file of the given language.
-  std::ostringstream comment;
+  cmOStringStream comment;
   comment << "Rule for compiling " << language << " files.";
-  std::ostringstream description;
+  cmOStringStream description;
   description << "Building " << language << " object $out";
   this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(language),
                                       cmdLine,
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index ca27530..113d678 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -18,6 +18,7 @@
 #include "cmSystemTools.h"
 
 #include <cmsys/Terminal.h>
+#include <cmsys/ios/sstream>
 
 #include <string.h>
 #if defined(__APPLE__)
@@ -549,7 +550,7 @@ bool cmQtAutomoc::RunAutomoc()
     this->GenerateMoc(it->first, it->second);
     }
 
-  std::stringstream outStream(std::stringstream::out);
+  cmsys_ios::stringstream outStream;
   outStream << "/* This file is autogenerated, do not edit*/\n";
 
   bool automocCppChanged = false;
@@ -1077,7 +1078,7 @@ bool cmQtAutomoc::EndsWith(const std::string& str, const std::string& with)
 std::string cmQtAutomoc::ReadAll(const std::string& filename)
 {
   std::ifstream file(filename.c_str());
-  std::stringstream stream;
+  cmsys_ios::stringstream stream;
   stream << file.rdbuf();
   file.close();
   return stream.str();

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list