Browse Source

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.
pull/314/merge
Brad King 8 years ago
parent
commit
f23def2cf3
  1. 5
      Modules/CMakeTestCCompiler.cmake
  2. 5
      Modules/CMakeTestCSharpCompiler.cmake
  3. 5
      Modules/CMakeTestCUDACompiler.cmake
  4. 5
      Modules/CMakeTestCXXCompiler.cmake
  5. 5
      Modules/CMakeTestFortranCompiler.cmake
  6. 5
      Modules/CMakeTestSwiftCompiler.cmake

5
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)

5
Modules/CMakeTestCSharpCompiler.cmake

@ -42,9 +42,10 @@ if(NOT CMAKE_CSharp_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_CSharp_COMPILER_OUTPUT}\n\n")
message(FATAL_ERROR "The C# compiler \"${CMAKE_CSharp_COMPILER}\" "
string(REPLACE "\n" "\n " _output "${__CMAKE_CSharp_COMPILER_OUTPUT}")
message(FATAL_ERROR "The C# compiler\n \"${CMAKE_CSharp_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n"
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(CSharp_TEST_WAS_RUN)

5
Modules/CMakeTestCUDACompiler.cmake

@ -42,9 +42,10 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CUDA compiler works failed with "
"the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n")
message(FATAL_ERROR "The CUDA compiler \"${CMAKE_CUDA_COMPILER}\" "
string(REPLACE "\n" "\n " _output "${__CMAKE_CUDA_COMPILER_OUTPUT}")
message(FATAL_ERROR "The CUDA compiler\n \"${CMAKE_CUDA_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n"
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(CUDA_TEST_WAS_RUN)

5
Modules/CMakeTestCXXCompiler.cmake

@ -41,9 +41,10 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
message(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
string(REPLACE "\n" "\n " _output "${__CMAKE_CXX_COMPILER_OUTPUT}")
message(FATAL_ERROR "The C++ compiler\n \"${CMAKE_CXX_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(CXX_TEST_WAS_RUN)

5
Modules/CMakeTestFortranCompiler.cmake

@ -41,9 +41,10 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler works failed with "
"the following output:\n${OUTPUT}\n\n")
message(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
string(REPLACE "\n" "\n " _output "${OUTPUT}")
message(FATAL_ERROR "The Fortran compiler\n \"${CMAKE_Fortran_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${OUTPUT}\n\n"
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(FORTRAN_TEST_WAS_RUN)

5
Modules/CMakeTestSwiftCompiler.cmake

@ -39,9 +39,10 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Swift compiler works failed with "
"the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
message(FATAL_ERROR "The Swift compiler \"${CMAKE_Swift_COMPILER}\" "
string(REPLACE "\n" "\n " _output "${__CMAKE_Swift_COMPILER_OUTPUT}")
message(FATAL_ERROR "The Swift compiler\n \"${CMAKE_Swift_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_Swift_COMPILER_OUTPUT}\n\n"
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(Swift_TEST_WAS_RUN)

Loading…
Cancel
Save