Commit 327490e6 authored by Brad King's avatar Brad King
Browse files

enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early

If the module reports a FATAL_ERROR, skip the rest of the steps to
enable the language to avoid unnecessary following error messages.
parent bbfebcbc
......@@ -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
......
^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\)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
enable_language(Fail)
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment