@@ -131,22 +131,20 @@ endfunction()
131
131
# Usage:
132
132
# _add_host_variant_c_compile_link_flags(name)
133
133
function (_add_host_variant_c_compile_link_flags name )
134
- swift_get_host_triple (target )
135
-
136
134
# MSVC and gcc don't understand -target.
137
135
# clang-cl understands --target.
138
136
if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
139
137
if ("${CMAKE_C_COMPILER_FRONTEND_VARIANT} " STREQUAL "MSVC" ) # clang-cl options
140
- target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :--target=${target } > )
141
- target_link_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :--target=${target } > )
138
+ target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :--target=${SWIFT_HOST_TRIPLE } > )
139
+ target_link_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :--target=${SWIFT_HOST_TRIPLE } > )
142
140
else ()
143
- target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :-target;${target } > )
144
- target_link_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :-target;${target } > )
141
+ target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :-target;${SWIFT_HOST_TRIPLE } > )
142
+ target_link_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX> :-target;${SWIFT_HOST_TRIPLE } > )
145
143
endif ()
146
144
endif ()
147
145
148
146
if (CMAKE_Swift_COMPILER )
149
- target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:Swift> :-target;${target } > )
147
+ target_compile_options (${name} PRIVATE $< $< COMPILE_LANGUAGE:Swift> :-target;${SWIFT_HOST_TRIPLE } > )
150
148
151
149
_add_host_variant_swift_sanitizer_flags (${name} )
152
150
endif ()
0 commit comments