[Cmake-commits] CMake branch, next, updated. v3.5.1-861-gf80b1fe
Brad King
brad.king at kitware.com
Thu Apr 7 09:46:00 EDT 2016
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 f80b1fe6c5c3a6a50166239920a6848877928fad (commit)
via 7731e44f87ca9f70335f211a4ef64a1ea68c7f10 (commit)
via f9644a2d1b52fb566bdad9a7211a86a167d73859 (commit)
via 24c9106b7b2c3729985b89b06a2732ee3f555022 (commit)
from 766a6d410995f190aa53ad79823855763e944b46 (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=f80b1fe6c5c3a6a50166239920a6848877928fad
commit f80b1fe6c5c3a6a50166239920a6848877928fad
Merge: 766a6d4 7731e44
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 7 09:45:58 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Apr 7 09:45:58 2016 -0400
Merge topic 'ninja-object-rsp' into next
7731e44f Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules
f9644a2d cmGlobalNinjaGenerator: Clarify logic for forcing use of response files
24c9106b cmNinjaTargetGenerator: Factor out helper for forced response file check
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7731e44f87ca9f70335f211a4ef64a1ea68c7f10
commit 7731e44f87ca9f70335f211a4ef64a1ea68c7f10
Author: Dmitry Ivanov <dmitry.ivanov at king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 7 09:45:29 2016 -0400
Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 87f0e3a..753a5ae 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -341,11 +341,25 @@ 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 +474,8 @@ cmNinjaTargetGenerator
comment.str(),
depfile,
deptype,
- /*rspfile*/ "",
- /*rspcontent*/ "",
+ rspfile,
+ rspcontent,
/*restat*/ "",
/*generator*/ false);
}
@@ -641,6 +655,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 +665,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=f9644a2d1b52fb566bdad9a7211a86a167d73859
commit f9644a2d1b52fb566bdad9a7211a86a167d73859
Author: Dmitry Ivanov <dmitry.ivanov at king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 7 09:45:29 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=24c9106b7b2c3729985b89b06a2732ee3f555022
commit 24c9106b7b2c3729985b89b06a2732ee3f555022
Author: Dmitry Ivanov <dmitry.ivanov at king.com>
AuthorDate: Wed Apr 6 12:55:15 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 7 09:45:26 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:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list