Skip to content

Commit f4a60df

Browse files
committed
build: explicitly error out if -print-target-info fails
Rather than trying to silently continue, catch an execution error and report it to the user. There is no possible recovery at this point.
1 parent 158729c commit f4a60df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Runtimes/Core/cmake/modules/PlatformInfo.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
1515
if(CMAKE_Swift_COMPILER_TARGET)
1616
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
1717
endif()
18-
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
18+
execute_process(COMMAND ${module_triple_command}
19+
OUTPUT_VARIABLE target_info_json
20+
ERROR_VARIABLE stderr
21+
RESULT_VARIABLE ec)
22+
if(ec)
23+
message(FATAL_ERROR "'${module_triple_command}' returned non-zero exit code ${ec}")
24+
message(CONFIGURE_LOG "Error Output: ${stderr}")
25+
endif()
1926
message(CONFIGURE_LOG "Swift target info: ${module_triple_command}\n"
2027
"${target_info_json}")
2128

0 commit comments

Comments
 (0)