Skip to content

Commit dd3cbf0

Browse files
committed
Add architecture specific path variables to SwiftConfigureSDK
New variables are introduced to track the path for the architecture specific subdirectories This work is mostly attributed to Zach Bowling
1 parent 2866f0e commit dd3cbf0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function(_report_sdk prefix)
2323
endforeach()
2424
else()
2525
message(STATUS " Path: ${SWIFT_SDK_${prefix}_PATH}")
26+
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
27+
message(STATUS " ${arch} Path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_PATH}")
28+
endforeach()
2629
endif()
2730
message(STATUS " Version: ${SWIFT_SDK_${prefix}_VERSION}")
2831
message(STATUS " Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
@@ -122,6 +125,9 @@ macro(configure_sdk_darwin
122125
set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "MACHO")
123126

124127
foreach(arch ${architectures})
128+
# On Darwin, all archs share the same SDK path.
129+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${SWIFT_SDK_${prefix}_PATH}")
130+
125131
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
126132
"${arch}-apple-${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
127133
endforeach()
@@ -137,8 +143,10 @@ macro(configure_sdk_unix
137143
# Note: this has to be implemented as a macro because it sets global
138144
# variables.
139145

146+
# Todo: this only supports building an SDK for one target arch only.
140147
set(SWIFT_SDK_${prefix}_NAME "${name}")
141148
set(SWIFT_SDK_${prefix}_PATH "${sdkpath}")
149+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${sdkpath}")
142150
set(SWIFT_SDK_${prefix}_VERSION "don't use")
143151
set(SWIFT_SDK_${prefix}_BUILD_NUMBER "don't use")
144152
set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "")
@@ -186,6 +194,7 @@ macro(configure_sdk_windows prefix sdk_name environment architectures)
186194
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
187195
"${arch}-unknown-windows-${environment}")
188196
endif()
197+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "/")
189198
endforeach()
190199

191200
# Add this to the list of known SDKs.

0 commit comments

Comments
 (0)