No public description

PiperOrigin-RevId: 557501469
This commit is contained in:
Sebastian Schmidt 2023-08-16 08:55:44 -07:00 committed by Copybara-Service
parent ff17846c6a
commit 251ffc21c8
2 changed files with 58 additions and 157 deletions

View File

@ -68,108 +68,30 @@ config_setting(
visibility = ["//visibility:public"],
)
# Generic MacOS.
config_setting(
# Note: this cannot just match "apple_platform_type": "macos" because that option
# defaults to "macos" even when building on Linux!
alias(
name = "macos",
constraint_values = [
"@platforms//os:macos",
],
actual = select({
":macos_i386": ":macos_i386",
":macos_x86_64": ":macos_x86_64",
":macos_arm64": ":macos_arm64",
"//conditions:default": ":macos_i386", # Arbitrarily chosen from above.
}),
visibility = ["//visibility:public"],
)
# MacOS x86 64-bit.
config_setting(
name = "macos_x86_64",
constraint_values = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
visibility = ["//visibility:public"],
)
# MacOS ARM64.
config_setting(
name = "macos_arm64",
constraint_values = [
"@platforms//os:macos",
"@platforms//cpu:arm64",
],
visibility = ["//visibility:public"],
)
# Generic iOS.
# Note: this also matches on crosstool_top so that it does not produce ambiguous
# selectors when used together with "android".
config_setting(
name = "ios",
constraint_values = [
"@platforms//os:ios",
],
values = {
"crosstool_top": "@bazel_tools//tools/cpp:toolchain",
"apple_platform_type": "ios",
},
visibility = ["//visibility:public"],
)
# iOS device ARM32.
config_setting(
name = "ios_armv7",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:arm",
],
visibility = ["//visibility:public"],
)
# iOS device ARM64.
config_setting(
name = "ios_arm64",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:arm64",
],
visibility = ["//visibility:public"],
)
# iOS device ARM64E.
config_setting(
name = "ios_arm64e",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:arm64e",
],
visibility = ["//visibility:public"],
)
# iOS simulator x86 32-bit.
config_setting(
name = "ios_i386",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:x86_32",
"@build_bazel_apple_support//constraints:simulator",
],
visibility = ["//visibility:public"],
)
# iOS simulator x86 64-bit.
config_setting(
name = "ios_x86_64",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:x86_64",
"@build_bazel_apple_support//constraints:simulator",
],
visibility = ["//visibility:public"],
)
# iOS simulator ARM64.
config_setting(
name = "ios_sim_arm64",
constraint_values = [
"@platforms//os:ios",
"@platforms//cpu:arm64",
"@build_bazel_apple_support//constraints:simulator",
],
visibility = ["//visibility:public"],
)
# Generic Apple.
alias(
name = "apple",
actual = select({
@ -180,6 +102,49 @@ alias(
visibility = ["//visibility:public"],
)
config_setting(
name = "macos_i386",
values = {
"apple_platform_type": "macos",
"cpu": "darwin",
},
visibility = ["//visibility:public"],
)
config_setting(
name = "macos_x86_64",
values = {
"apple_platform_type": "macos",
"cpu": "darwin_x86_64",
},
visibility = ["//visibility:public"],
)
config_setting(
name = "macos_arm64",
values = {
"apple_platform_type": "macos",
"cpu": "darwin_arm64",
},
visibility = ["//visibility:public"],
)
[
config_setting(
name = arch,
values = {"cpu": arch},
visibility = ["//visibility:public"],
)
for arch in [
"ios_i386",
"ios_x86_64",
"ios_armv7",
"ios_arm64",
"ios_arm64e",
"ios_sim_arm64",
]
]
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},

View File

@ -1,64 +0,0 @@
# This file allows automatically mapping flags such as '--cpu' to the more
# modern Bazel platforms (https://bazel.build/concepts/platforms).
# In particular, Bazel platforms lack support for Apple for now if no such
# mapping is put into place. It's inspired from:
# https://github.com/bazelbuild/rules_apple/issues/1764
platforms:
@build_bazel_apple_support//platforms:macos_x86_64
--cpu=darwin_x86_64
@build_bazel_apple_support//platforms:macos_arm64
--cpu=darwin_arm64
@build_bazel_apple_support//platforms:ios_i386
--cpu=ios_i386
@build_bazel_apple_support//platforms:ios_x86_64
--cpu=ios_x86_64
@build_bazel_apple_support//platforms:ios_sim_arm64
--cpu=ios_sim_arm64
@build_bazel_apple_support//platforms:ios_armv7
--cpu=ios_armv7
@build_bazel_apple_support//platforms:ios_arm64
--cpu=ios_arm64
@build_bazel_apple_support//platforms:ios_arm64e
--cpu=ios_arm64e
flags:
--cpu=darwin_x86_64
--apple_platform_type=macos
@build_bazel_apple_support//platforms:macos_x86_64
--cpu=darwin_arm64
--apple_platform_type=macos
@build_bazel_apple_support//platforms:macos_arm64
--cpu=ios_i386
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_i386
--cpu=ios_x86_64
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_x86_64
--cpu=ios_sim_arm64
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_sim_arm64
--cpu=ios_armv7
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_armv7
--cpu=ios_arm64
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_arm64
--cpu=ios_arm64e
--apple_platform_type=ios
@build_bazel_apple_support//platforms:ios_arm64e