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()
63
63
64
64
# Determine the module triple.
65
65
if ("${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 )
68
67
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} )
82
69
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" )
83
72
endif ()
84
73
message (STATUS "Module triple: ${SWIFT_HOST_MODULE_TRIPLE} " )
85
74
You can’t perform that action at this time.
0 commit comments