summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2015-08-09 17:51:35 (GMT)
committerJames Johnston <johnstonj.public@codenest.com>2015-08-09 17:51:35 (GMT)
commit874e70bc57f54e5fc898a169797a0b1e45df31f6 (patch)
tree9c5b7f90aa2770f15c4492a38d0f5afc27fdda44 /Source/cmGlobalNinjaGenerator.cxx
parentc5ac2b9df36a57d3b88e80a2d1c382d753faf2da (diff)
downloadCMake-874e70bc57f54e5fc898a169797a0b1e45df31f6.zip
CMake-874e70bc57f54e5fc898a169797a0b1e45df31f6.tar.gz
CMake-874e70bc57f54e5fc898a169797a0b1e45df31f6.tar.bz2
Ninja: Prevent generating if installed Ninja version is too old.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
1 files changed, 12 insertions, 0 deletions
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();