diff options
author | Brad King <brad.king@kitware.com> | 2016-09-21 19:05:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-22 17:53:09 (GMT) |
commit | 9a77680eed49939f8ba418af96eefd42ecea0ae1 (patch) | |
tree | cd0f4e9a8848803c91fc6b6269a5c226283ee2d5 /Source/cmGlobalNinjaGenerator.cxx | |
parent | 0f331d7893bee523e61109661d4e51566f41c350 (diff) | |
download | CMake-9a77680eed49939f8ba418af96eefd42ecea0ae1.zip CMake-9a77680eed49939f8ba418af96eefd42ecea0ae1.tar.gz CMake-9a77680eed49939f8ba418af96eefd42ecea0ae1.tar.bz2 |
Ninja: Conditionally allow Fortran based on ninja 'dyndep' support
Detect from the version of Ninja whether it supports the dynamically
discovered dependencies (dyndep) feature needed to support Fortran.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c0503eb..81690e7 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -595,14 +595,49 @@ bool cmGlobalNinjaGenerator::CheckLanguages( { if (std::find(languages.begin(), languages.end(), "Fortran") != languages.end()) { - mf->IssueMessage(cmake::FATAL_ERROR, - "The Ninja generator does not support Fortran yet."); - cmSystemTools::SetFatalErrorOccured(); - return false; + return this->CheckFortran(mf); } return true; } +bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const +{ + if (this->NinjaSupportsDyndeps == 1) { + return true; + } + + std::ostringstream e; + if (this->NinjaSupportsDyndeps == 0) { + /* clang-format off */ + e << + "The Ninja generator does not support Fortran using Ninja version\n" + " " + this->NinjaVersion + "\n" + "due to lack of required features. " + "Kitware has implemented the required features but as of this version " + "of CMake they have not been integrated to upstream ninja. " + "Pending integration, Kitware maintains a branch at:\n" + " https://github.com/Kitware/ninja/tree/features-for-fortran#readme\n" + "with the required features. " + "One may build ninja from that branch to get support for Fortran." + ; + /* clang-format on */ + } else { + /* clang-format off */ + e << + "The Ninja generator in this version of CMake does not support Fortran " + "using Ninja version\n" + " " + this->NinjaVersion + "\n" + "because its 'dyndep' feature version is " << + this->NinjaSupportsDyndeps << ". " + "This version of CMake is aware only of 'dyndep' feature version 1." + ; + /* clang-format on */ + } + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; +} + void cmGlobalNinjaGenerator::EnableLanguage( std::vector<std::string> const& langs, cmMakefile* mf, bool optional) { |