Skip to content

Commit b06ac15

Browse files
authored
Merge pull request #85467 from compnerd/execution
build: explicitly error out if `-print-target-info` fails
2 parents 87c858b + f4a60df commit b06ac15

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)