Skip to content

Commit c3fe715

Browse files
lanzajrose-apple
authored andcommitted
Change the arch argument for configure_sdk_unix to architectures (#15756)
General purpose cross compilation from host x to targets a,b,c will require the ability to have multiple architectures passed to `configure_sdk_unix`. Simply change the function to accept multiple archs.
1 parent afad78f commit c3fe715

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,28 @@ macro(configure_sdk_darwin
143143
endmacro()
144144

145145
macro(configure_sdk_unix
146-
prefix name lib_subdir triple_name arch triple sdkpath)
146+
prefix name lib_subdir triple_name architectures triple sdkpath)
147147
# Note: this has to be implemented as a macro because it sets global
148148
# variables.
149149

150-
# Todo: this only supports building an SDK for one target arch only.
151150
set(SWIFT_SDK_${prefix}_NAME "${name}")
152-
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${sdkpath}")
153151
set(SWIFT_SDK_${prefix}_VERSION "don't use")
154152
set(SWIFT_SDK_${prefix}_BUILD_NUMBER "don't use")
155153
set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "")
156154
set(SWIFT_SDK_${prefix}_LIB_SUBDIR "${lib_subdir}")
157155
set(SWIFT_SDK_${prefix}_VERSION_MIN_NAME "")
158156
set(SWIFT_SDK_${prefix}_TRIPLE_NAME "${triple_name}")
159-
set(SWIFT_SDK_${prefix}_ARCHITECTURES "${arch}")
157+
set(SWIFT_SDK_${prefix}_ARCHITECTURES "${architectures}")
160158
if("${prefix}" STREQUAL "CYGWIN")
161159
set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "COFF")
162160
else()
163161
set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "ELF")
164162
endif()
165163

166-
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE "${triple}")
164+
foreach(arch ${architectures})
165+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${sdkpath}")
166+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE "${triple}")
167+
endforeach()
167168

168169
# Add this to the list of known SDKs.
169170
list(APPEND SWIFT_CONFIGURED_SDKS "${prefix}")

0 commit comments

Comments
 (0)