@@ -68,7 +68,7 @@ function(_report_sdk prefix)
6868endfunction ()
6969
7070# Remove architectures not supported by the SDK from the given list.
71- function (remove_sdk_unsupported_archs name os sdk_path architectures_var)
71+ function (remove_sdk_unsupported_archs name os sdk_path deployment_version architectures_var)
7272 execute_process (COMMAND
7373 /usr/libexec/PlistBuddy -c "Print :SupportedTargets:${os} :Archs" ${sdk_path} /SDKSettings.plist
7474 OUTPUT_VARIABLE sdk_supported_archs
@@ -87,11 +87,11 @@ function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
8787 # 32-bit iOS simulator is not listed explicitly in SDK settings.
8888 message (STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch} " )
8989 list (APPEND architectures ${arch} )
90- elseif (arch STREQUAL "armv7k" AND os STREQUAL "watchos" )
90+ elseif (arch STREQUAL "armv7k" AND os STREQUAL "watchos" AND deployment_version VERSION_LESS "9.0" )
9191 # 32-bit watchOS is not listed explicitly in SDK settings.
9292 message (STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch} " )
9393 list (APPEND architectures ${arch} )
94- elseif (arch STREQUAL "i386" AND os STREQUAL "watchsimulator" )
94+ elseif (arch STREQUAL "i386" AND os STREQUAL "watchsimulator" AND deployment_version VERSION_LESS "7.0" )
9595 # 32-bit watchOS simulator is not listed explicitly in SDK settings.
9696 message (STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch} " )
9797 list (APPEND architectures ${arch} )
@@ -229,7 +229,7 @@ macro(configure_sdk_darwin
229229 endif ()
230230
231231 # Remove any architectures not supported by the SDK.
232- remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix} _PATH} SWIFT_SDK_${prefix} _ARCHITECTURES)
232+ remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix} _PATH} "${SWIFT_SDK_ ${prefix} _DEPLOYMENT_VERSION}" SWIFT_SDK_${prefix} _ARCHITECTURES)
233233
234234 list_intersect(
235235 "${SWIFT_DARWIN_MODULE_ARCHS} " # lhs
0 commit comments