Ninja: Prevent generating if installed Ninja version is too old.

This commit is contained in:
James Johnston 2015-08-09 13:51:35 -04:00
parent c5ac2b9df3
commit 874e70bc57
1 changed files with 12 additions and 0 deletions

View File

@ -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();