diff --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt --- a/compiler-rt/lib/crt/CMakeLists.txt +++ b/compiler-rt/lib/crt/CMakeLists.txt @@ -53,6 +53,10 @@ endif() endforeach() + # Strip quotes from the compile command, as the compiler is not expecting + # quoted arguments (potential quotes added from D62063). + string(REPLACE "\"" "" test_compile_command "${test_compile_command}") + string(REPLACE " " ";" test_compile_command "${test_compile_command}") execute_process( @@ -62,6 +66,12 @@ ERROR_VARIABLE TEST_ERROR ) + # Explicitly throw a fatal error message if test_compile_command fails. + if(TEST_RESULT) + message(FATAL_ERROR "${TEST_ERROR}") + return() + endif() + execute_process( COMMAND ${CMAKE_OBJDUMP} -h "${TARGET_NAME}/CheckSectionExists.o" RESULT_VARIABLE CHECK_RESULT