diff options
author | Brad King <brad.king@kitware.com> | 2015-06-30 14:23:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-06-30 14:23:31 (GMT) |
commit | 7e3ac12df45fa42b590971accaf1db89b1a0ffb6 (patch) | |
tree | 480940822cee039d85e629364ce62e9c777a1882 | |
parent | 5ff47ea93d490616292aae88847b42d56200d9e7 (diff) | |
parent | 327490e698db7a74f6a8e8543e99c6c7c9333a8f (diff) | |
download | CMake-7e3ac12df45fa42b590971accaf1db89b1a0ffb6.zip CMake-7e3ac12df45fa42b590971accaf1db89b1a0ffb6.tar.gz CMake-7e3ac12df45fa42b590971accaf1db89b1a0ffb6.tar.bz2 |
Merge topic 'enable_language-fail-earlier'
327490e6 enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/Languages/DetermineFail-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Languages/DetermineFail-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Languages/DetermineFail.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Languages/Modules/CMakeDetermineFailCompiler.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Languages/RunCMakeTest.cmake | 2 |
6 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 14eaeac..23ab93d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -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 diff --git a/Tests/RunCMake/Languages/DetermineFail-result.txt b/Tests/RunCMake/Languages/DetermineFail-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Languages/DetermineFail-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/DetermineFail-stderr.txt b/Tests/RunCMake/Languages/DetermineFail-stderr.txt new file mode 100644 index 0000000..3b4743e --- /dev/null +++ b/Tests/RunCMake/Languages/DetermineFail-stderr.txt @@ -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\) diff --git a/Tests/RunCMake/Languages/DetermineFail.cmake b/Tests/RunCMake/Languages/DetermineFail.cmake new file mode 100644 index 0000000..3c8d17d --- /dev/null +++ b/Tests/RunCMake/Languages/DetermineFail.cmake @@ -0,0 +1,2 @@ +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules) +enable_language(Fail) diff --git a/Tests/RunCMake/Languages/Modules/CMakeDetermineFailCompiler.cmake b/Tests/RunCMake/Languages/Modules/CMakeDetermineFailCompiler.cmake new file mode 100644 index 0000000..3b2d50a --- /dev/null +++ b/Tests/RunCMake/Languages/Modules/CMakeDetermineFailCompiler.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This language is not supported.") diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake index 6517a81..732baae 100644 --- a/Tests/RunCMake/Languages/RunCMakeTest.cmake +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -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) |