summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 12:00:38 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-19 13:14:40 (GMT)
commitf23def2cf3d5dbb62f615db1c42cda68877131a5 (patch)
tree6b14dea0930f4a6e83da230a6e99a89e5543369e /Modules/CMakeTestCCompiler.cmake
parent4547d9a83030f8ae7e636cef16a261c65e6feb40 (diff)
downloadCMake-f23def2cf3d5dbb62f615db1c42cda68877131a5.zip
CMake-f23def2cf3d5dbb62f615db1c42cda68877131a5.tar.gz
CMake-f23def2cf3d5dbb62f615db1c42cda68877131a5.tar.bz2
Improve formatting of compiler failure error message
When we report that a compiler was unable to build a simple test program, indent the output of the attempt so that our message formatting will show it as a pre-formatted block.
Diffstat (limited to 'Modules/CMakeTestCCompiler.cmake')
-rw-r--r--Modules/CMakeTestCCompiler.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 7f19969..e34ae75 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -48,9 +48,10 @@ if(NOT CMAKE_C_COMPILER_WORKS)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the C compiler works failed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
- message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
+ string(REPLACE "\n" "\n " _output "${__CMAKE_C_COMPILER_OUTPUT}")
+ message(FATAL_ERROR "The C compiler\n \"${CMAKE_C_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
- "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
+ "with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(C_TEST_WAS_RUN)