Merge topic 'enable_language-fail-earlier'
327490e6
enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early
This commit is contained in:
commit
7e3ac12df4
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -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\)
|
|
@ -0,0 +1,2 @@
|
|||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
|
||||
enable_language(Fail)
|
|
@ -0,0 +1 @@
|
|||
message(FATAL_ERROR "This language is not supported.")
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue