Skip to content

Commit b341802

Browse files
dflemscopybara-github
authored andcommitted
[apple] support watchos_arm64 in toolchain
The watch-only changes from #14439 Closes #14512. PiperOrigin-RevId: 420296580
1 parent ec05613 commit b341802

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

tools/osx/crosstool/BUILD.toolchains

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ OSX_TOOLS_CONSTRAINTS = {
5252
"@platforms//os:ios",
5353
"@platforms//cpu:x86_64",
5454
],
55+
"watchos_arm64": [
56+
"@platforms//os:ios",
57+
"@platforms//cpu:aarch64",
58+
],
5559
"watchos_arm64_32": [
5660
"@platforms//os:ios",
5761
"@platforms//cpu:aarch64",

tools/osx/crosstool/cc_toolchain_config.bzl

+15-6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def _impl(ctx):
7676
target_system_name = "x86_64-apple-ios"
7777
elif (ctx.attr.cpu == "ios_sim_arm64"):
7878
target_system_name = "arm64-apple-ios-simulator"
79+
elif (ctx.attr.cpu == "watchos_arm64"):
80+
target_system_name = "arm64-apple-watchos-simulator"
7981
elif (ctx.attr.cpu == "darwin_x86_64"):
8082
target_system_name = "x86_64-apple-macosx"
8183
elif (ctx.attr.cpu == "darwin_arm64"):
@@ -744,7 +746,8 @@ def _impl(ctx):
744746
ctx.attr.cpu == "watchos_arm64_32" or
745747
ctx.attr.cpu == "watchos_armv7k" or
746748
ctx.attr.cpu == "watchos_i386" or
747-
ctx.attr.cpu == "watchos_x86_64"):
749+
ctx.attr.cpu == "watchos_x86_64" or
750+
ctx.attr.cpu == "watchos_arm64"):
748751
apply_default_compiler_flags_feature = feature(
749752
name = "apply_default_compiler_flags",
750753
flag_sets = [
@@ -928,7 +931,8 @@ def _impl(ctx):
928931
ctx.attr.cpu == "ios_sim_arm64" or
929932
ctx.attr.cpu == "tvos_x86_64" or
930933
ctx.attr.cpu == "watchos_i386" or
931-
ctx.attr.cpu == "watchos_x86_64"):
934+
ctx.attr.cpu == "watchos_x86_64" or
935+
ctx.attr.cpu == "watchos_arm64"):
932936
apply_simulator_compiler_flags_feature = feature(
933937
name = "apply_simulator_compiler_flags",
934938
flag_sets = [
@@ -1000,7 +1004,8 @@ def _impl(ctx):
10001004
ctx.attr.cpu == "watchos_arm64_32" or
10011005
ctx.attr.cpu == "watchos_armv7k" or
10021006
ctx.attr.cpu == "watchos_i386" or
1003-
ctx.attr.cpu == "watchos_x86_64"):
1007+
ctx.attr.cpu == "watchos_x86_64" or
1008+
ctx.attr.cpu == "watchos_arm64"):
10041009
contains_objc_source_feature = feature(
10051010
name = "contains_objc_source",
10061011
flag_sets = [
@@ -1312,7 +1317,9 @@ def _impl(ctx):
13121317
),
13131318
],
13141319
)
1315-
elif (ctx.attr.cpu == "watchos_i386" or ctx.attr.cpu == "watchos_x86_64"):
1320+
elif (ctx.attr.cpu == "watchos_i386" or
1321+
ctx.attr.cpu == "watchos_x86_64" or
1322+
ctx.attr.cpu == "watchos_arm64"):
13161323
version_min_feature = feature(
13171324
name = "version_min",
13181325
flag_sets = [
@@ -1762,7 +1769,8 @@ def _impl(ctx):
17621769
ctx.attr.cpu == "watchos_arm64_32" or
17631770
ctx.attr.cpu == "watchos_armv7k" or
17641771
ctx.attr.cpu == "watchos_i386" or
1765-
ctx.attr.cpu == "watchos_x86_64"):
1772+
ctx.attr.cpu == "watchos_x86_64" or
1773+
ctx.attr.cpu == "watchos_arm64"):
17661774
apply_implicit_frameworks_feature = feature(
17671775
name = "apply_implicit_frameworks",
17681776
flag_sets = [
@@ -2846,7 +2854,8 @@ def _impl(ctx):
28462854
ctx.attr.cpu == "watchos_arm64_32" or
28472855
ctx.attr.cpu == "watchos_armv7k" or
28482856
ctx.attr.cpu == "watchos_i386" or
2849-
ctx.attr.cpu == "watchos_x86_64"):
2857+
ctx.attr.cpu == "watchos_x86_64" or
2858+
ctx.attr.cpu == "watchos_arm64"):
28502859
features = [
28512860
fastbuild_feature,
28522861
no_legacy_features_feature,

tools/osx/crosstool/osx_archs.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ OSX_TOOLS_NON_DEVICE_ARCHS = [
2121
"ios_i386",
2222
"ios_x86_64",
2323
"ios_sim_arm64",
24+
"watchos_arm64",
2425
"watchos_i386",
2526
"watchos_x86_64",
2627
"tvos_x86_64",

0 commit comments

Comments
 (0)