summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-21 17:52:01 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-22 17:51:58 (GMT)
commitf0a23aa3dbbe2751bbb4969e1371380561b566ee (patch)
tree78b8a93723e83d5376661091ab9957eb6ee0e815 /Source/cmGlobalNinjaGenerator.cxx
parentf4475eb92beade22fca16f21b40df19b48c6559b (diff)
downloadCMake-f0a23aa3dbbe2751bbb4969e1371380561b566ee.zip
CMake-f0a23aa3dbbe2751bbb4969e1371380561b566ee.tar.gz
CMake-f0a23aa3dbbe2751bbb4969e1371380561b566ee.tar.bz2
Ninja: Refactor Fortran rejection logic
Delay rejection of Fortran until after we've determined the version of the `ninja` tool to be used. This will later allow us to enable Fortran support based on the version of ninja. While at it, make the rejection an immediate fatal error. Also provide a stack trace so readers know what code tried to enable Fortran.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b913621..8146ea5 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -561,12 +561,22 @@ void cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf)
}
}
+bool cmGlobalNinjaGenerator::CheckLanguages(
+ std::vector<std::string> const& languages, cmMakefile* mf) const
+{
+ 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 true;
+}
+
void cmGlobalNinjaGenerator::EnableLanguage(
std::vector<std::string> const& langs, cmMakefile* mf, bool optional)
{
- if (std::find(langs.begin(), langs.end(), "Fortran") != langs.end()) {
- cmSystemTools::Error("The Ninja generator does not support Fortran yet.");
- }
this->cmGlobalGenerator::EnableLanguage(langs, mf, optional);
for (std::vector<std::string>::const_iterator l = langs.begin();
l != langs.end(); ++l) {