Skip to content

Commit b76df51

Browse files
committed
[watchos] Switch to building i386 sim and armv7k interfaces only
When the deployment target is above 9.0 (7.0 for simulator), only build the module content such as the swiftinterface, as the support for building dylibs for those arches goes away in that release.
1 parent 081774a commit b76df51

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ set(SWIFT_DARWIN_SUPPORTED_ARCHS "" CACHE STRING
468468
"Semicolon-separated list of architectures to configure on Darwin platforms. \
469469
If left empty all default architectures are configured.")
470470

471-
set(SWIFT_DARWIN_MODULE_ARCHS "" CACHE STRING
471+
set(SWIFT_DARWIN_MODULE_ARCHS "i386;armv7k" CACHE STRING
472472
"Semicolon-separated list of architectures to configure Swift module-only \
473473
targets on Darwin platforms. These targets are in addition to the full \
474474
library targets.")

cmake/modules/DarwinSDKs.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ set(SUPPORTED_OSX_ARCHS "x86_64;arm64")
88
set(SUPPORTED_XROS_ARCHS "arm64;arm64e")
99
set(SUPPORTED_XROS_SIMULATOR_ARCHS "arm64")
1010

11-
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 7.0)
12-
list(REMOVE_ITEM SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
13-
endif()
14-
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 9.0)
15-
list(REMOVE_ITEM SUPPORTED_WATCHOS_ARCHS "armv7k")
16-
endif()
17-
1811
is_sdk_requested(OSX swift_build_osx)
1912
if(swift_build_osx)
2013
configure_sdk_darwin(

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function(_report_sdk prefix)
6868
endfunction()
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

Comments
 (0)