Merge topic 'enable_language-fail-earlier'

327490e6 enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early
This commit is contained in:
Brad King 2015-06-30 10:23:31 -04:00 committed by CMake Topic Stage
commit 7e3ac12df4
6 changed files with 15 additions and 0 deletions

View File

@ -564,6 +564,10 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
cmSystemTools::Error("Could not find cmake module file: ",
determineCompiler.c_str());
}
if (cmSystemTools::GetFatalErrorOccured())
{
return;
}
needTestLanguage[lang] = true;
// Some generators like visual studio should not use the env variables
// So the global generator can specify that in this variable

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,5 @@
^CMake Error at Modules/CMakeDetermineFailCompiler.cmake:[0-9]+ \(message\):
This language is not supported.
Call Stack \(most recent call first\):
DetermineFail.cmake:[0-9]+ \(enable_language\)
CMakeLists.txt:[0-9]+ \(include\)

View File

@ -0,0 +1,2 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
enable_language(Fail)

View File

@ -0,0 +1 @@
message(FATAL_ERROR "This language is not supported.")

View File

@ -4,3 +4,5 @@ run_cmake(NoLangSHARED)
run_cmake(LINK_LANGUAGE-genex)
run_cmake(link-libraries-TARGET_FILE-genex)
run_cmake(link-libraries-TARGET_FILE-genex-ok)
run_cmake(DetermineFail)