File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -63,23 +63,12 @@ endif()
6363
6464# Determine the module triple.
6565if ("${SWIFT_HOST_MODULE_TRIPLE} " STREQUAL "" )
66- # FIXME: This is a hack. It's all a hack. Windows isn't setting
67- # CMAKE_Swift_COMPILER_TARGET.
66+ set (module_triple_command "${CMAKE_Swift_COMPILER} " -print-target -info)
6867 if (CMAKE_Swift_COMPILER_TARGET)
69- string (REGEX REPLACE "macosx[0-9]+([.][0-9]+)?" "macos" SWIFT_HOST_MODULE_TRIPLE
70- ${CMAKE_Swift_COMPILER_TARGET} )
71- elseif ("${CMAKE_SYSTEM_NAME} " STREQUAL "Windows" )
72- if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
73- set (SWIFT_HOST_MODULE_TRIPLE "x86_64-unknown-windows-msvc" )
74- elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64" )
75- set (SWIFT_HOST_MODULE_TRIPLE "aarch64-unknown-windows-msvc" )
76- else ()
77- message (FATAL_ERROR "Unrecognized architecture for Windows host" )
78- endif ()
79- else ()
80- execute_process (COMMAND ${CMAKE_Swift_COMPILER} -print-target -info OUTPUT_VARIABLE target_info)
81- string (JSON SWIFT_HOST_MODULE_TRIPLE GET ${target_info} target moduleTriple)
68+ list (APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET} )
8269 endif ()
70+ execute_process (COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
71+ string (JSON SWIFT_HOST_MODULE_TRIPLE GET "${target_info_json} " "target" "moduleTriple" )
8372endif ()
8473message (STATUS "Module triple: ${SWIFT_HOST_MODULE_TRIPLE} " )
8574
You can’t perform that action at this time.
0 commit comments