[Cmake-commits] CMake branch, next, updated. v3.3.0-2109-g8618bdc
James Johnston
johnstonj.public at codenest.com
Sun Aug 9 13:59:02 EDT 2015
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 8618bdc60bfe0f81fe5ce1e1c31afdcf69eb692e (commit)
via 874e70bc57f54e5fc898a169797a0b1e45df31f6 (commit)
via c5ac2b9df36a57d3b88e80a2d1c382d753faf2da (commit)
via 101ba25e6a2c177f9f3a81f3879a171256806756 (commit)
from 43e2c0863b0c71fe5573a8d9def948fa7c40cdff (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=8618bdc60bfe0f81fe5ce1e1c31afdcf69eb692e
commit 8618bdc60bfe0f81fe5ce1e1c31afdcf69eb692e
Merge: 43e2c08 874e70b
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sun Aug 9 13:59:02 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Aug 9 13:59:02 2015 -0400
Merge topic 'ninja-version-handling' into next
874e70bc Ninja: Prevent generating if installed Ninja version is too old.
c5ac2b9d Ninja: Centralized required Ninja version numbers and comparisons.
101ba25e CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=874e70bc57f54e5fc898a169797a0b1e45df31f6
commit 874e70bc57f54e5fc898a169797a0b1e45df31f6
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sun Aug 9 13:51:35 2015 -0400
Commit: James Johnston <johnstonj.public at codenest.com>
CommitDate: Sun Aug 9 13:51:35 2015 -0400
Ninja: Prevent generating if installed Ninja version is too old.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b46d85c..b92ad32 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -547,6 +547,18 @@ void cmGlobalNinjaGenerator
// Source/cmake.cxx
void cmGlobalNinjaGenerator::Generate()
{
+ // Check minimum Ninja version.
+ if (cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
+ CurrentNinjaVersion().c_str(),
+ RequiredNinjaVersion().c_str()))
+ {
+ std::ostringstream msg;
+ msg << "The detected version of Ninja (" << this->CurrentNinjaVersion();
+ msg << ") is less than the version of Ninja required by CMake (";
+ msg << this->RequiredNinjaVersion() << ").";
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, msg.str());
+ return;
+ }
this->OpenBuildFileStream();
this->OpenRulesFileStream();
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c5ac2b9df36a57d3b88e80a2d1c382d753faf2da
commit c5ac2b9df36a57d3b88e80a2d1c382d753faf2da
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sat Aug 8 20:04:08 2015 +0000
Commit: James Johnston <johnstonj.public at codenest.com>
CommitDate: Sun Aug 9 13:31:24 2015 -0400
Ninja: Centralized required Ninja version numbers and comparisons.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 088f0e1..b46d85c 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1256,7 +1256,7 @@ std::string cmGlobalNinjaGenerator::ninjaCmd() const
return "ninja";
}
-std::string cmGlobalNinjaGenerator::ninjaVersion() const
+std::string cmGlobalNinjaGenerator::CurrentNinjaVersion() const
{
std::string version;
std::string command = ninjaCmd() + " --version";
@@ -1264,13 +1264,14 @@ std::string cmGlobalNinjaGenerator::ninjaVersion() const
&version, 0, 0, 0,
cmSystemTools::OUTPUT_NONE);
- return version;
+ return cmSystemTools::TrimWhitespace(version);
}
bool cmGlobalNinjaGenerator::SupportsConsolePool() const
{
return cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
- ninjaVersion().c_str(), "1.5") == false;
+ CurrentNinjaVersion().c_str(),
+ RequiredNinjaVersionForConsolePool().c_str()) == false;
}
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 2a749c1..a1df1c2 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -299,8 +299,10 @@ public:
virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
- std::string ninjaVersion() const;
-
+ std::string CurrentNinjaVersion() const;
+ // Ninja generator uses 'deps' and 'msvc_deps_prefix' introduced in 1.3
+ static std::string RequiredNinjaVersion() { return "1.3"; }
+ static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; }
bool SupportsConsolePool() const;
protected:
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 9889bd4..aaad075 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -193,16 +193,14 @@ void cmLocalNinjaGenerator::WriteProjectHeader(std::ostream& os)
void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os)
{
// Default required version
- // Ninja generator uses 'deps' and 'msvc_deps_prefix' introduced in 1.3
- std::string requiredVersion = "1.3";
+ std::string requiredVersion =
+ this->GetGlobalNinjaGenerator()->RequiredNinjaVersion();
// Ninja generator uses the 'console' pool if available (>= 1.5)
- std::string usedVersion = this->GetGlobalNinjaGenerator()->ninjaVersion();
- if(cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
- usedVersion.c_str(),
- "1.5") == false)
+ if(this->GetGlobalNinjaGenerator()->SupportsConsolePool())
{
- requiredVersion = "1.5";
+ requiredVersion =
+ this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForConsolePool();
}
cmGlobalNinjaGenerator::WriteComment(os,
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeVersion.cmake | 2 +-
Source/cmGlobalNinjaGenerator.cxx | 19 ++++++++++++++++---
Source/cmGlobalNinjaGenerator.h | 6 ++++--
Source/cmLocalNinjaGenerator.cxx | 12 +++++-------
4 files changed, 26 insertions(+), 13 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list