Skip to content

Commit

Permalink
[apple] support watchos_arm64 in toolchain
Browse files Browse the repository at this point in the history
The watch-only changes from bazelbuild#14439

Closes bazelbuild#14512.

PiperOrigin-RevId: 420296580
  • Loading branch information
dflems authored and Copybara-Service committed Jan 7, 2022
1 parent ec05613 commit b341802
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 4 additions & 0 deletions tools/osx/crosstool/BUILD.toolchains
Expand Up @@ -52,6 +52,10 @@ OSX_TOOLS_CONSTRAINTS = {
"@platforms//os:ios",
"@platforms//cpu:x86_64",
],
"watchos_arm64": [
"@platforms//os:ios",
"@platforms//cpu:aarch64",
],
"watchos_arm64_32": [
"@platforms//os:ios",
"@platforms//cpu:aarch64",
Expand Down
21 changes: 15 additions & 6 deletions tools/osx/crosstool/cc_toolchain_config.bzl
Expand Up @@ -76,6 +76,8 @@ def _impl(ctx):
target_system_name = "x86_64-apple-ios"
elif (ctx.attr.cpu == "ios_sim_arm64"):
target_system_name = "arm64-apple-ios-simulator"
elif (ctx.attr.cpu == "watchos_arm64"):
target_system_name = "arm64-apple-watchos-simulator"
elif (ctx.attr.cpu == "darwin_x86_64"):
target_system_name = "x86_64-apple-macosx"
elif (ctx.attr.cpu == "darwin_arm64"):
Expand Down Expand Up @@ -744,7 +746,8 @@ def _impl(ctx):
ctx.attr.cpu == "watchos_arm64_32" or
ctx.attr.cpu == "watchos_armv7k" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
apply_default_compiler_flags_feature = feature(
name = "apply_default_compiler_flags",
flag_sets = [
Expand Down Expand Up @@ -928,7 +931,8 @@ def _impl(ctx):
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "tvos_x86_64" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
apply_simulator_compiler_flags_feature = feature(
name = "apply_simulator_compiler_flags",
flag_sets = [
Expand Down Expand Up @@ -1000,7 +1004,8 @@ def _impl(ctx):
ctx.attr.cpu == "watchos_arm64_32" or
ctx.attr.cpu == "watchos_armv7k" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
contains_objc_source_feature = feature(
name = "contains_objc_source",
flag_sets = [
Expand Down Expand Up @@ -1312,7 +1317,9 @@ def _impl(ctx):
),
],
)
elif (ctx.attr.cpu == "watchos_i386" or ctx.attr.cpu == "watchos_x86_64"):
elif (ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
version_min_feature = feature(
name = "version_min",
flag_sets = [
Expand Down Expand Up @@ -1762,7 +1769,8 @@ def _impl(ctx):
ctx.attr.cpu == "watchos_arm64_32" or
ctx.attr.cpu == "watchos_armv7k" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
apply_implicit_frameworks_feature = feature(
name = "apply_implicit_frameworks",
flag_sets = [
Expand Down Expand Up @@ -2846,7 +2854,8 @@ def _impl(ctx):
ctx.attr.cpu == "watchos_arm64_32" or
ctx.attr.cpu == "watchos_armv7k" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
ctx.attr.cpu == "watchos_x86_64" or
ctx.attr.cpu == "watchos_arm64"):
features = [
fastbuild_feature,
no_legacy_features_feature,
Expand Down
1 change: 1 addition & 0 deletions tools/osx/crosstool/osx_archs.bzl
Expand Up @@ -21,6 +21,7 @@ OSX_TOOLS_NON_DEVICE_ARCHS = [
"ios_i386",
"ios_x86_64",
"ios_sim_arm64",
"watchos_arm64",
"watchos_i386",
"watchos_x86_64",
"tvos_x86_64",
Expand Down

0 comments on commit b341802

Please sign in to comment.