diff options
author | Brad King <brad.king@kitware.com> | 2023-01-16 18:44:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-18 21:41:00 (GMT) |
commit | 24ccc8c3c95e25bcd9991f0dca02c084ae56bc76 (patch) | |
tree | 5869d053ce7b94660d6354d6fc3eca89ae4815ba /Modules/CMakeDetermineCompilerId.cmake | |
parent | 95976514f605e83c4db5e1dd176398653b0d42cd (diff) | |
download | CMake-24ccc8c3c95e25bcd9991f0dca02c084ae56bc76.zip CMake-24ccc8c3c95e25bcd9991f0dca02c084ae56bc76.tar.gz CMake-24ccc8c3c95e25bcd9991f0dca02c084ae56bc76.tar.bz2 |
CompilerId: Restore logging of failed identifications
Changes in commit 9c5bd7fe3a (CompilerId: Output errors from all
attempts at detection, 2022-08-16, v3.25.0-rc1~290^2) accidentally
stopped logging failed compiler identification build output.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 7f392c8..828e02f 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -724,7 +724,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line" ) # Compilation failed. - string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG + set(MSG "Compiling the ${lang} compiler identification source file \"${src}\" failed. ${COMPILER_DESCRIPTION} The output was: @@ -737,11 +737,13 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}") endif() + string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${MSG}") + # Some languages may know the correct/desired set of flags and want to fail right away if they don't work. # This is currently only used by CUDA. if(__compiler_id_require_success) message(FATAL_ERROR "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}") - else() + elseif(CMAKE_${lang}_COMPILER_ID_REQUIRE_SUCCESS) # Build up the outputs for compiler detection attempts so that users # can see all set of flags tried, instead of just last set(_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}" PARENT_SCOPE) |