diff options
author | Brad King <brad.king@kitware.com> | 2022-08-17 12:41:50 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-08-17 08:44:26 -0400 |
commit | 8c144f06820767c1338162cb020a5c2a30cf26eb (patch) | |
tree | 0bcd1fa3d64e01685d11874f37ffddb1f81d17bd /Modules | |
parent | b0ab42c120120f36c4ed315a05df9e8ea9c8ecf2 (diff) | |
parent | 9c5bd7fe3acc18fc5c1a4d22b1435aeb34d274e6 (diff) | |
download | cmake-8c144f06820767c1338162cb020a5c2a30cf26eb.tar.gz |
Merge topic 'output_all_attempts_at_compiler_detection'
9c5bd7fe3a CompilerId: Output errors from all attempts at detection
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7576
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 2b19736d47..6b5854941f 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -720,7 +720,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line" ) # Compilation failed. - set(MSG + string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "Compiling the ${lang} compiler identification source file \"${src}\" failed. ${COMPILER_DESCRIPTION} The output was: @@ -736,7 +736,11 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # 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 "${MSG}") + message(FATAL_ERROR "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}") + else() + # 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) endif() # No output files should be inspected. |