diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 21 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 848028f..c628406 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -398,6 +398,21 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, return; } + std::set<std::string> cur_languages(languages.begin(), languages.end()); + for (std::set<std::string>::iterator li = cur_languages.begin(); + li != cur_languages.end(); ++li) + { + if (!this->LanguagesInProgress.insert(*li).second) + { + std::ostringstream e; + e << "Language '" << *li << "' is currently being enabled. " + "Recursive call not allowed."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + cmSystemTools::SetFatalErrorOccured(); + return; + } + } + if(this->TryCompileOuterMakefile) { // In a try-compile we can only enable languages provided by caller. @@ -823,6 +838,12 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, { cmSystemTools::SetFatalErrorOccured(); } + + for (std::set<std::string>::iterator li = cur_languages.begin(); + li != cur_languages.end(); ++li) + { + this->LanguagesInProgress.erase(*li); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 48fa704..6e819d3 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -457,6 +457,7 @@ private: // in EnableLanguagesFromGenerator std::map<std::string, bool> IgnoreExtensions; std::set<std::string> LanguagesReady; // Ready for try_compile + std::set<std::string> LanguagesInProgress; std::map<std::string, std::string> OutputExtensions; std::map<std::string, std::string> LanguageToOutputExtension; std::map<std::string, std::string> ExtensionToLanguage; |