[Cmake-commits] CMake branch, next, updated. v2.8.8-3181-g2f61975
Peter Kuemmel
syntheticpp at gmx.net
Thu Jun 14 20:06:35 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 2f61975b8b3125e03d6c7d01b6ca833d75bff1a1 (commit)
via 41c28dc35ba7efaf9426a8b8f5597aee11b7db61 (commit)
via f13a6a087e3f882b496ab34c12cc7777795a5c2f (commit)
from 81c6e8c768eb77e83bdbf6ccbb4fd9a023f67db5 (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=2f61975b8b3125e03d6c7d01b6ca833d75bff1a1
commit 2f61975b8b3125e03d6c7d01b6ca833d75bff1a1
Merge: 81c6e8c 41c28dc
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Thu Jun 14 20:06:27 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 14 20:06:27 2012 -0400
Merge topic 'ninja-cldeps' into next
41c28dc Ninja: be more accurate when estimating the command line length
f13a6a0 Ninja: undo all the NOSHELL patches
diff --cc Source/cmLocalNinjaGenerator.cxx
index 8dbe81d,5d193cd..9a496f2
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@@ -280,13 -272,12 +272,12 @@@ std::string cmLocalNinjaGenerator::Buil
// don't use POST_BUILD.
if (cmdLines.empty())
#ifdef _WIN32
- return "";
+ return "cd.";
#else
- // TODO use _NOSHELL rule also on Linux
- return nopCommand();
+ return ":";
#endif
- std::ostringstream cmd;
+ cmOStringStream cmd;
for (std::vector<std::string>::const_iterator li = cmdLines.begin();
li != cmdLines.end(); ++li) {
if (li != cmdLines.begin()) {
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41c28dc35ba7efaf9426a8b8f5597aee11b7db61
commit 41c28dc35ba7efaf9426a8b8f5597aee11b7db61
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Jun 15 01:45:18 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Fri Jun 15 02:00:15 2012 +0200
Ninja: be more accurate when estimating the command line length
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 3af58a9..30a4a07 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -177,7 +177,8 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
// check if a response file rule should be used
const std::string args = arguments.str();
- if (cmdLineLimit > 0 && args.size() > (size_t)cmdLineLimit)
+ if (cmdLineLimit > 0 &&
+ (args.size() + + builds.str().size()) > (size_t)cmdLineLimit)
builds << "_RSPFILE";
os << builds.str() << args;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 6f08338..98d2fba 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -478,12 +478,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
symlinkVars["POST_BUILD"] = postBuildCmdLine;
}
- int cmdLineLimit = -1;
+ int cmdLineLimit;
#ifdef _WIN32
- cmdLineLimit = 8100;
+ cmdLineLimit = 8000;
#else
- // TODO
+ cmdLineLimit = -1; // TODO
#endif
+
// Write the build statement for this target.
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),
comment.str(),
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f13a6a087e3f882b496ab34c12cc7777795a5c2f
commit f13a6a087e3f882b496ab34c12cc7777795a5c2f
Author: Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Jun 15 01:43:08 2012 +0200
Commit: Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Fri Jun 15 01:43:08 2012 +0200
Ninja: undo all the NOSHELL patches
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index d8da5ed..3af58a9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -106,7 +106,6 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
const cmNinjaDeps& implicitDeps,
const cmNinjaDeps& orderOnlyDeps,
const cmNinjaVars& variables,
- bool suppressShell,
int cmdLineLimit)
{
// Make sure there is a rule.
@@ -178,15 +177,8 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
// check if a response file rule should be used
const std::string args = arguments.str();
- if (suppressShell)
- {
- builds << "_NOSHELL";
- }
- else if (cmdLineLimit > 0 &&
- args.size() + builds.str().size() > (size_t)cmdLineLimit)
- {
+ if (cmdLineLimit > 0 && args.size() > (size_t)cmdLineLimit)
builds << "_RSPFILE";
- }
os << builds.str() << args;
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 244fd3b..2055375 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -84,7 +84,6 @@ public:
const cmNinjaDeps& implicitDeps,
const cmNinjaDeps& orderOnlyDeps,
const cmNinjaVars& variables,
- bool suppressShell = false,
int cmdLineLimit = -1);
/**
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 71f0913..5d193cd 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -264,14 +264,6 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps(const cmCustomCommand *cc,
}
}
-std::string cmLocalNinjaGenerator::nopCommand() const {
-#ifdef _WIN32
- return "cd .";
-#else
- return ":";
-#endif
-}
-
std::string cmLocalNinjaGenerator::BuildCommandLine(
const std::vector<std::string> &cmdLines)
{
@@ -280,10 +272,9 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
// don't use POST_BUILD.
if (cmdLines.empty())
#ifdef _WIN32
- return "";
+ return "cd.";
#else
- // TODO use _NOSHELL rule also on Linux
- return nopCommand();
+ return ":";
#endif
std::ostringstream cmd;
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 9df4afb..ea44b2f 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -111,7 +111,6 @@ private:
void AppendCustomCommandDeps(const cmCustomCommand *cc,
cmNinjaDeps &ninjaDeps);
- std::string nopCommand() const;
std::string BuildCommandLine(const std::vector<std::string> &cmdLines);
void AppendCustomCommandLines(const cmCustomCommand *cc,
std::vector<std::string> &cmdLines);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2dcfcb3..6f08338 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -75,13 +75,9 @@ void cmNinjaNormalTargetGenerator::Generate()
}
else
{
- this->WriteLinkRule();
-#ifdef _WIN32
- // TODO remove hardcoded strings
- this->WriteLinkRule("_RSPFILE");
- this->WriteLinkRule("_NOSHELL");
-#else
- // TODO response file support only Linux
+ this->WriteLinkRule(false);
+#ifdef _WIN32 // TODO response file support only Linux
+ this->WriteLinkRule(true);
#endif
this->WriteLinkStatement();
}
@@ -135,18 +131,12 @@ cmNinjaNormalTargetGenerator
void
cmNinjaNormalTargetGenerator
-::WriteLinkRule(const std::string& postfix)
+::WriteLinkRule(bool useResponseFile)
{
cmTarget::TargetType targetType = this->GetTarget()->GetType();
std::string ruleName = this->LanguageLinkerRule();
-
- bool useResponseFile = false;
- bool suppressShell = false;
- if (!postfix.empty()) {
- ruleName += postfix;
- useResponseFile = (postfix == "_RSPFILE");
- suppressShell = (postfix == "_NOSHELL");
- }
+ if (useResponseFile)
+ ruleName += "_RSPFILE";
// Select whether to use a response file for objects.
std::string rspfile;
@@ -220,10 +210,8 @@ cmNinjaNormalTargetGenerator
{
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
}
- if (!suppressShell) {
- linkCmds.insert(linkCmds.begin(), "$PRE_LINK");
- linkCmds.push_back("$POST_BUILD");
- }
+ linkCmds.insert(linkCmds.begin(), "$PRE_LINK");
+ linkCmds.push_back("$POST_BUILD");
std::string linkCmd =
this->GetLocalGenerator()->BuildCommandLine(linkCmds);
@@ -343,7 +331,6 @@ cmNinjaNormalTargetGenerator
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
{
- cmLocalNinjaGenerator* locGtor = this->GetLocalGenerator();
cmTarget::TargetType targetType = this->GetTarget()->GetType();
// Write comments.
@@ -381,10 +368,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmNinjaDeps explicitDeps = this->GetObjects(),
implicitDeps = this->ComputeLinkDeps();
- locGtor->GetTargetFlags(vars["LINK_LIBRARIES"],
- vars["FLAGS"],
- vars["LINK_FLAGS"],
- *this->GetTarget());
+ this->GetLocalGenerator()->GetTargetFlags(vars["LINK_LIBRARIES"],
+ vars["FLAGS"],
+ vars["LINK_FLAGS"],
+ *this->GetTarget());
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);
@@ -394,7 +381,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::string flags = (targetType == cmTarget::EXECUTABLE
? vars["FLAGS"]
: vars["ARCH_FLAGS"]);
- locGtor->AddArchitectureFlags(flags,
+ this->GetLocalGenerator()->AddArchitectureFlags(flags,
this->GetTarget(),
this->TargetLinkLanguage,
this->GetConfigName());
@@ -413,16 +400,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (!install_name_dir.empty()) {
vars["INSTALLNAME_DIR"] =
- locGtor->Convert(install_name_dir.c_str(),
- cmLocalGenerator::NONE,
- cmLocalGenerator::SHELL, false);
+ this->GetLocalGenerator()->Convert(install_name_dir.c_str(),
+ cmLocalGenerator::NONE,
+ cmLocalGenerator::SHELL, false);
}
}
}
std::string path;
if (!this->TargetNameImport.empty()) {
- path = locGtor->ConvertToOutputFormat(
+ path = this->GetLocalGenerator()->ConvertToOutputFormat(
targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
vars["TARGET_IMPLIB"] = path;
EnsureParentDirectoryExists(path);
@@ -434,7 +421,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
{
path = this->GetTargetPDB();
- vars["TARGET_PDB"] = locGtor->ConvertToOutputFormat(
+ vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(path.c_str()).c_str(),
cmLocalGenerator::SHELL);
EnsureParentDirectoryExists(path);
@@ -464,53 +451,38 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
for (std::vector<cmCustomCommand>::const_iterator
ci = cmdLists[i]->begin();
ci != cmdLists[i]->end(); ++ci) {
- locGtor->AppendCustomCommandLines(&*ci, *cmdLineLists[i]);
+ this->GetLocalGenerator()->AppendCustomCommandLines(&*ci,
+ *cmdLineLists[i]);
}
}
// If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
// the link commands.
if (!preLinkCmdLines.empty()) {
- path = locGtor->ConvertToOutputFormat(
+ path = this->GetLocalGenerator()->ConvertToOutputFormat(
this->GetMakefile()->GetHomeOutputDirectory(),
cmLocalGenerator::SHELL);
preLinkCmdLines.push_back("cd " + path);
- vars["PRE_LINK"] = locGtor->BuildCommandLine(preLinkCmdLines);
}
+ vars["PRE_LINK"] =
+ this->GetLocalGenerator()->BuildCommandLine(preLinkCmdLines);
+ std::string postBuildCmdLine =
+ this->GetLocalGenerator()->BuildCommandLine(postBuildCmdLines);
+
cmNinjaVars symlinkVars;
- if (!postBuildCmdLines.empty()) {
- std::string postBuildCmdLine =
- locGtor->BuildCommandLine(postBuildCmdLines);
-
- if (targetOutput == targetOutputReal) {
- vars["POST_BUILD"] = postBuildCmdLine;
- if (preLinkCmdLines.empty()) {
- // rule with PRE_LINK will be selected, feed it
- vars["PRE_LINK"] = locGtor->nopCommand();
- }
- } else {
- symlinkVars["POST_BUILD"] = postBuildCmdLine;
- }
+ if (targetOutput == targetOutputReal) {
+ vars["POST_BUILD"] = postBuildCmdLine;
+ } else {
+ vars["POST_BUILD"] = ":";
+ symlinkVars["POST_BUILD"] = postBuildCmdLine;
}
- bool suppressShell = preLinkCmdLines.empty() && postBuildCmdLines.empty();
-
int cmdLineLimit = -1;
#ifdef _WIN32
- cmdLineLimit = 8000;
+ cmdLineLimit = 8100;
#else
- // cmdLineLimit = ?? TODO
- suppressShell = false;
-
- // TODO also use _NOSHELL rule
- if (vars.find("PRE_LINK") == vars.end())
- vars["PRE_LINK"] = locGtor->nopCommand();
- if (vars.find("POST_BUILD") == vars.end())
- vars["POST_BUILD"] = locGtor->nopCommand();
- if (targetOutput != targetOutputReal &&
- symlinkVars.find("POST_BUILD") == symlinkVars.end())
- symlinkVars["POST_BUILD"] = locGtor->nopCommand();
+ // TODO
#endif
// Write the build statement for this target.
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),
@@ -521,7 +493,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
implicitDeps,
emptyDeps,
vars,
- suppressShell,
cmdLineLimit);
if (targetOutput != targetOutputReal) {
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 299b3e1..1ef9567 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -30,7 +30,7 @@ private:
std::string LanguageLinkerRule() const;
const char* GetVisibleTypeName() const;
void WriteLanguagesRules();
- void WriteLinkRule(const std::string& postfix = "");
+ void WriteLinkRule(bool useResponseFile);
void WriteLinkStatement();
void WriteObjectLibStatement();
std::vector<std::string> ComputeLinkCmd();
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalNinjaGenerator.cxx | 11 +---
Source/cmGlobalNinjaGenerator.h | 1 -
Source/cmLocalNinjaGenerator.cxx | 13 +----
Source/cmLocalNinjaGenerator.h | 1 -
Source/cmNinjaNormalTargetGenerator.cxx | 96 +++++++++++--------------------
Source/cmNinjaNormalTargetGenerator.h | 2 +-
6 files changed, 39 insertions(+), 85 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list