Skip to content

Commit cca1312

Browse files
authored
Update SwiftWindowsSupport.cmake
Do not attempt to use a cross-compiled compiler for a foreign target. This is not guaranteed to work (e.g. building for ARM on x64). This at least surfaces the error properly.
1 parent 60f3d61 commit cca1312

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/modules/SwiftWindowsSupport.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ endfunction()
8181
# NOTE(compnerd) we use a macro here as this modifies global variables
8282
macro(swift_swap_compiler_if_needed target)
8383
if(NOT CMAKE_C_COMPILER_ID MATCHES Clang)
84-
if(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
84+
if(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
8585
if(SWIFT_BUILT_STANDALONE)
8686
get_target_property(CLANG_LOCATION clang LOCATION)
8787
get_filename_component(CLANG_LOCATION ${CLANG_LOCATION} DIRECTORY)

0 commit comments

Comments
 (0)