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  685ce51d88db1f69ac378a7a6f23f41101520870 (commit)
       via  cbe471cba2964364d0fe8834882af42697f1ab07 (commit)
       via  4650fe2e7af96eadd8c95bec9655f809b6a80e2d (commit)
       via  d20f5551f82b4f3f4d18bc7fb3f2229817eb8e6d (commit)
      from  26f7aade193cd6aa9a7e48e039637c39d178ff17 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=685ce51d88db1f69ac378a7a6f23f41101520870
commit 685ce51d88db1f69ac378a7a6f23f41101520870
Merge: 26f7aad cbe471c
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Apr 7 09:43:14 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Apr 7 09:43:14 2016 -0400

    Merge topic 'ninja-object-rsp' into next
    
    cbe471cb Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules
    4650fe2e cmGlobalNinjaGenerator: Clarify logic for forcing use of response 
files
    d20f5551 cmNinjaTargetGenerator: Factor out helper for forced response file 
check


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbe471cba2964364d0fe8834882af42697f1ab07
commit cbe471cba2964364d0fe8834882af42697f1ab07
Author:     Dmitry Ivanov <dmitry.iva...@king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 7 09:33:10 2016 -0400

    Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules

diff --git a/Source/cmNinjaTargetGenerator.cxx 
b/Source/cmNinjaTargetGenerator.cxx
index 87f0e3a..4fb1ec7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -341,11 +341,24 @@ cmNinjaTargetGenerator
 
   cmMakefile* mf = this->GetMakefile();
 
+  std::string flags = "$FLAGS";
+  std::string rspfile;
+  std::string rspcontent;
+  std::string responseFlag;
+
+  if (this->ForceResponseFile()) {
+    rspfile = "$RSP_FILE";
+    responseFlag = "@" + rspfile;
+    rspcontent = " $DEFINES $INCLUDES $FLAGS";
+    flags = responseFlag;
+    vars.Defines = "";
+    vars.Includes = "";
+  }
+
   // Tell ninja dependency format so all deps can be loaded into a database
   std::string deptype;
   std::string depfile;
   std::string cldeps;
-  std::string flags = "$FLAGS";
   if (this->NeedDepTypeMSVC(lang))
     {
     deptype = "msvc";
@@ -460,8 +473,8 @@ cmNinjaTargetGenerator
                                       comment.str(),
                                       depfile,
                                       deptype,
-                                      /*rspfile*/ "",
-                                      /*rspcontent*/ "",
+                                      rspfile,
+                                      rspcontent,
                                       /*restat*/ "",
                                       /*generator*/ false);
 }
@@ -641,6 +654,9 @@ cmNinjaTargetGenerator
 
   this->SetMsvcTargetPdbVariable(vars);
 
+  int const commandLineLengthLimit = this->ForceResponseFile() ? -1 : 0;
+  std::string const rspfile = objectFileName + ".rsp";
+
   this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(),
                                          comment,
                                          rule,
@@ -648,7 +664,10 @@ cmNinjaTargetGenerator
                                          explicitDeps,
                                          implicitDeps,
                                          orderOnlyDeps,
-                                         vars);
+                                         vars,
+                                         rspfile,
+                                         commandLineLengthLimit);
+
 
   if(const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) {
     std::vector<std::string> outputList;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4650fe2e7af96eadd8c95bec9655f809b6a80e2d
commit 4650fe2e7af96eadd8c95bec9655f809b6a80e2d
Author:     Dmitry Ivanov <dmitry.iva...@king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 7 09:12:18 2016 -0400

    cmGlobalNinjaGenerator: Clarify logic for forcing use of response files
    
    Update the WriteBuild method to use a negative command line length limit
    to specify that we should force use of response files.

diff --git a/Source/cmGlobalNinjaGenerator.cxx 
b/Source/cmGlobalNinjaGenerator.cxx
index f12396f..fadb0cf 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -230,9 +230,10 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
   std::string assignments = variable_assignments.str();
   const std::string& args = arguments;
   bool useResponseFile = false;
-  if (cmdLineLimit > 0
-      && args.size() + buildstr.size() + assignments.size()
-                                                    > (size_t) cmdLineLimit) {
+  if (cmdLineLimit < 0 ||
+      (cmdLineLimit > 0 &&
+       (args.size() + buildstr.size() + assignments.size())
+       > static_cast<size_t>(cmdLineLimit))) {
     variable_assignments.str(std::string());
     cmGlobalNinjaGenerator::WriteVariable(variable_assignments,
                                           "RSP_FILE", rspfile, "", 1);
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 3023a95..3093a11 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -94,7 +94,7 @@ public:
                   const cmNinjaDeps& orderOnlyDeps,
                   const cmNinjaVars& variables,
                   const std::string& rspfile = std::string(),
-                  int cmdLineLimit = -1,
+                  int cmdLineLimit = 0,
                   bool* usedResponseFile = 0);
 
   /**
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index 54cacef..322f37d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -697,7 +697,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 
   cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();
 
-  int commandLineLengthLimit = 1;
+  int commandLineLengthLimit = -1;
   if (!this->ForceResponseFile())
     {
     commandLineLengthLimit = calculateCommandLineLengthLimit(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d20f5551f82b4f3f4d18bc7fb3f2229817eb8e6d
commit d20f5551f82b4f3f4d18bc7fb3f2229817eb8e6d
Author:     Dmitry Ivanov <dmitry.iva...@king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 7 09:04:49 2016 -0400

    cmNinjaTargetGenerator: Factor out helper for forced response file check

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index c34df3c..54cacef 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -698,9 +698,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();
 
   int commandLineLengthLimit = 1;
-  const char* forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
-  if (!mf->IsDefinitionSet(forceRspFile) &&
-      cmSystemTools::GetEnv(forceRspFile) == 0)
+  if (!this->ForceResponseFile())
     {
     commandLineLengthLimit = calculateCommandLineLengthLimit(
                 globalGen.GetRuleCmdLength(this->LanguageLinkerRule()));
diff --git a/Source/cmNinjaTargetGenerator.cxx 
b/Source/cmNinjaTargetGenerator.cxx
index 5ff4fdb..87f0e3a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -795,3 +795,10 @@ void cmNinjaTargetGenerator::addPoolNinjaVariable(
       vars["pool"] = pool;
       }
 }
+
+bool cmNinjaTargetGenerator::ForceResponseFile()
+{
+  static std::string const forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
+  return (this->GetMakefile()->IsDefinitionSet(forceRspFile) ||
+          cmSystemTools::GetEnv(forceRspFile) != 0);
+}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index e3ec423..371bc3c 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -152,6 +152,8 @@ protected:
                             cmGeneratorTarget* target,
                             cmNinjaVars& vars);
 
+  bool ForceResponseFile();
+
 private:
   cmLocalNinjaGenerator* LocalGenerator;
   /// List of object files for this target.

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

Summary of changes:
 Source/cmGlobalNinjaGenerator.cxx       |    7 ++++---
 Source/cmGlobalNinjaGenerator.h         |    2 +-
 Source/cmNinjaNormalTargetGenerator.cxx |    6 ++----
 Source/cmNinjaTargetGenerator.cxx       |   34 +++++++++++++++++++++++++++----
 Source/cmNinjaTargetGenerator.h         |    2 ++
 5 files changed, 39 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to