[Cmake-commits] CMake branch, next, updated. v2.8.8-3423-gd67a635
Peter Kuemmel
syntheticpp at gmx.net
Tue Jul 10 04:57:38 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 d67a635d5af74aaa1ea27d4d1ff924e569d4aa48 (commit)
via 3856e6698eb80d4ee3d8d7606c16e5fa3a2bef8c (commit)
via 8c1e35c19505a1382e5c43a32cbdfe5379dc65d3 (commit)
via 7f647cf5ebf0b45663cdabe4fd137b87753b857c (commit)
via 6274ca6f910683495124d22e371a1adc9cf0eebc (commit)
from f6f64e2d1b382ff80e2d2f83869f18efedacdb1a (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=d67a635d5af74aaa1ea27d4d1ff924e569d4aa48
commit d67a635d5af74aaa1ea27d4d1ff924e569d4aa48
Merge: f6f64e2 3856e66
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Tue Jul 10 04:57:36 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 10 04:57:36 2012 -0400
Merge topic 'ninja-rspfile-link-libraries' into next
3856e66 Ninja: error on missing rspfile_content
8c1e35c Ninja: remove some unused default arguments
7f647cf Ninja: also write link libraries to rsp file
6274ca6 CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3856e6698eb80d4ee3d8d7606c16e5fa3a2bef8c
commit 3856e6698eb80d4ee3d8d7606c16e5fa3a2bef8c
Author: Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Tue Jul 10 10:42:24 2012 +0200
Commit: Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Tue Jul 10 10:53:25 2012 +0200
Ninja: error on missing rspfile_content
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2bb409c..07cc75f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -306,11 +306,15 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
if(!rspfile.empty())
{
- cmGlobalNinjaGenerator::Indent(os, 1);
- os << "rspfile = " << rspfile << "\n";
- cmGlobalNinjaGenerator::Indent(os, 1);
- os << "rspfile_content = " <<
- (rspcontent.empty() ? "$in" :rspcontent) << "\n";
+ if (rspcontent.empty())
+ {
+ cmSystemTools::Error("No rspfile_content given!", comment.c_str());
+ return;
+ }
+ cmGlobalNinjaGenerator::Indent(os, 1);
+ os << "rspfile = " << rspfile << "\n";
+ cmGlobalNinjaGenerator::Indent(os, 1);
+ os << "rspfile_content = " << rspcontent << "\n";
}
if(restat)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c1e35c19505a1382e5c43a32cbdfe5379dc65d3
commit 8c1e35c19505a1382e5c43a32cbdfe5379dc65d3
Author: Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Tue Jul 10 10:37:31 2012 +0200
Commit: Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Tue Jul 10 10:53:24 2012 +0200
Ninja: remove some unused default arguments
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 9431c57..ff4f85d 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -114,12 +114,12 @@ public:
const std::string& name,
const std::string& command,
const std::string& description,
- const std::string& comment = "",
- const std::string& depfile = "",
- const std::string& rspfile = "",
- const std::string& rspcontent = "",
- bool restat = false,
- bool generator = false);
+ const std::string& comment,
+ const std::string& depfile,
+ const std::string& rspfile,
+ const std::string& rspcontent,
+ bool restat,
+ bool generator);
/**
* Write a variable named @a name to @a os with value @a value and an
@@ -232,7 +232,7 @@ public:
void AddRule(const std::string& name,
const std::string& command,
const std::string& description,
- const std::string& comment = "",
+ const std::string& comment,
const std::string& depfile = "",
const std::string& rspfile = "",
const std::string& rspcontent = "",
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f647cf5ebf0b45663cdabe4fd137b87753b857c
commit 7f647cf5ebf0b45663cdabe4fd137b87753b857c
Author: Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Tue Jul 10 09:56:11 2012 +0200
Commit: Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Tue Jul 10 10:53:24 2012 +0200
Ninja: also write link libraries to rsp file
and enable rspfile support on Linux, needed for commands longer than e.g. 2096152 characters on Ubuntu.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9829d19..2bb409c 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -217,6 +217,7 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule()
"Rule for running custom commands.",
/*depfile*/ "",
/*rspfile*/ "",
+ /*rspcontent*/ "",
/*restat*/ true);
}
@@ -258,6 +259,7 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
const std::string& comment,
const std::string& depfile,
const std::string& rspfile,
+ const std::string& rspcontent,
bool restat,
bool generator)
{
@@ -307,7 +309,8 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
cmGlobalNinjaGenerator::Indent(os, 1);
os << "rspfile = " << rspfile << "\n";
cmGlobalNinjaGenerator::Indent(os, 1);
- os << "rspfile_content = $in" << "\n";
+ os << "rspfile_content = " <<
+ (rspcontent.empty() ? "$in" :rspcontent) << "\n";
}
if(restat)
@@ -538,6 +541,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
const std::string& comment,
const std::string& depfile,
const std::string& rspfile,
+ const std::string& rspcontent,
bool restat,
bool generator)
{
@@ -555,6 +559,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
comment,
depfile,
rspfile,
+ rspcontent,
restat,
generator);
@@ -911,6 +916,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
"Rule for re-running cmake.",
/*depfile=*/ "",
/*rspfile=*/ "",
+ /*rspcontent*/ "",
/*restat=*/ false,
/*generator=*/ true);
@@ -960,6 +966,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
"Rule for cleaning all built files.",
/*depfile=*/ "",
/*rspfile=*/ "",
+ /*rspcontent*/ "",
/*restat=*/ false,
/*generator=*/ false);
WriteBuild(os,
@@ -981,6 +988,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
"Rule for printing all primary targets available.",
/*depfile=*/ "",
/*rspfile=*/ "",
+ /*rspcontent*/ "",
/*restat=*/ false,
/*generator=*/ false);
WriteBuild(os,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index e5f8099..9431c57 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -116,7 +116,8 @@ public:
const std::string& description,
const std::string& comment = "",
const std::string& depfile = "",
- const std::string& rspfile = "" ,
+ const std::string& rspfile = "",
+ const std::string& rspcontent = "",
bool restat = false,
bool generator = false);
@@ -234,6 +235,7 @@ public:
const std::string& comment = "",
const std::string& depfile = "",
const std::string& rspfile = "",
+ const std::string& rspcontent = "",
bool restat = false,
bool generator = false);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 0cf90aa..1fd6a16 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -75,10 +75,8 @@ void cmNinjaNormalTargetGenerator::Generate()
}
else
{
- this->WriteLinkRule(false);
-#ifdef _WIN32 // TODO response file support only Linux
- this->WriteLinkRule(true);
-#endif
+ this->WriteLinkRule(false); // write rule without rspfile support
+ this->WriteLinkRule(true); // write rule with rspfile support
this->WriteLinkStatement();
}
}
@@ -140,6 +138,7 @@ cmNinjaNormalTargetGenerator
// Select whether to use a response file for objects.
std::string rspfile;
+ std::string rspcontent;
if (!this->GetGlobalGenerator()->HasRule(ruleName)) {
cmLocalGenerator::RuleVariables vars;
@@ -150,6 +149,7 @@ cmNinjaNormalTargetGenerator
std::string responseFlag;
if (!useResponseFile) {
vars.Objects = "$in";
+ vars.LinkLibraries = "$LINK_LIBRARIES";
} else {
// handle response file
std::string cmakeLinkVar = std::string("CMAKE_") +
@@ -162,7 +162,9 @@ cmNinjaNormalTargetGenerator
}
rspfile = "$out.rsp";
responseFlag += rspfile;
+ rspcontent = "$in $LINK_LIBRARIES";
vars.Objects = responseFlag.c_str();
+ vars.LinkLibraries = "";
}
vars.ObjectDir = "$OBJECT_DIR";
@@ -189,7 +191,6 @@ cmNinjaNormalTargetGenerator
vars.TargetVersionMajor = targetVersionMajor.c_str();
vars.TargetVersionMinor = targetVersionMinor.c_str();
- vars.LinkLibraries = "$LINK_LIBRARIES";
vars.Flags = "$FLAGS";
vars.LinkFlags = "$LINK_FLAGS";
@@ -227,7 +228,8 @@ cmNinjaNormalTargetGenerator
description.str(),
comment.str(),
/*depfile*/ "",
- rspfile);
+ rspfile,
+ rspcontent);
}
if (this->TargetNameOut != this->TargetNameReal) {
@@ -478,12 +480,15 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
symlinkVars["POST_BUILD"] = postBuildCmdLine;
}
- int cmdLineLimit;
-#ifdef _WIN32
- cmdLineLimit = 8000 - this->GetGlobalGenerator()->
+ int linkRuleLength = this->GetGlobalGenerator()->
GetRuleCmdLength(this->LanguageLinkerRule());
+#ifdef _WIN32
+ int commandLineLengthLimit = 8000 - linkRuleLength;
+#elif __linux
+ // for instance ARG_MAX is 2096152 on Ubuntu
+ int commandLineLengthLimit = sysconf(_SC_ARG_MAX) - linkRuleLength - 1000;
#else
- cmdLineLimit = -1; // TODO
+ int commandLineLengthLimit = -1;
#endif
// Write the build statement for this target.
@@ -495,7 +500,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
implicitDeps,
emptyDeps,
vars,
- cmdLineLimit);
+ commandLineLengthLimit);
if (targetOutput != targetOutputReal) {
if (targetType == cmTarget::EXECUTABLE) {
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeVersion.cmake | 2 +-
Source/cmGlobalNinjaGenerator.cxx | 20 ++++++++++++++++----
Source/cmGlobalNinjaGenerator.h | 14 ++++++++------
Source/cmNinjaNormalTargetGenerator.cxx | 27 ++++++++++++++++-----------
4 files changed, 41 insertions(+), 22 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list