From e50397c44435b433843881b69e3a81733ac377ba Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 30 Jul 2019 12:29:49 -0700 Subject: [PATCH] Add Apple CPU and OS constraint values to bazel_platforms. RELNOTES: None PiperOrigin-RevId: 260771264 Change-Id: I85439e1dbf607bd689d14a7c1d8d8e3762f720be --- cpu/BUILD | 64 ++++++++++++++++++++++++++++++++++++++++++++----------- os/BUILD | 39 ++++++++++++++++++++++++--------- 2 files changed, 81 insertions(+), 22 deletions(-) diff --git a/cpu/BUILD b/cpu/BUILD index 8b76bff..54d5712 100644 --- a/cpu/BUILD +++ b/cpu/BUILD @@ -14,17 +14,7 @@ filegroup( constraint_setting(name = "cpu") constraint_value( - name = "x86_32", - constraint_setting = ":cpu", -) - -constraint_value( - name = "x86_64", - constraint_setting = ":cpu", -) - -constraint_value( - name = "ppc", + name = "aarch64", constraint_setting = ":cpu", ) @@ -34,7 +24,47 @@ constraint_value( ) constraint_value( - name = "aarch64", + name = "arm64_32", + constraint_setting = ":cpu", +) + +constraint_value( + name = "arm64", + constraint_setting = ":cpu", +) + +constraint_value( + name = "arm64e", + constraint_setting = ":cpu", +) + +constraint_value( + name = "armv6", + constraint_setting = ":cpu", +) + +constraint_value( + name = "armv7", + constraint_setting = ":cpu", +) + +constraint_value( + name = "armv7k", + constraint_setting = ":cpu", +) + +constraint_value( + name = "armv7s", + constraint_setting = ":cpu", +) + +constraint_value( + name = "i386", + constraint_setting = ":cpu", +) + +constraint_value( + name = "ppc", constraint_setting = ":cpu", ) @@ -42,3 +72,13 @@ constraint_value( name = "s390x", constraint_setting = ":cpu", ) + +constraint_value( + name = "x86_32", + constraint_setting = ":cpu", +) + +constraint_value( + name = "x86_64", + constraint_setting = ":cpu", +) diff --git a/os/BUILD b/os/BUILD index 5446917..e8a5050 100644 --- a/os/BUILD +++ b/os/BUILD @@ -13,16 +13,6 @@ filegroup( # To add a new constraint_value see https://github.com/bazelbuild/platforms. constraint_setting(name = "os") -constraint_value( - name = "osx", - constraint_setting = ":os", -) - -constraint_value( - name = "ios", - constraint_setting = ":os", -) - constraint_value( name = "freebsd", constraint_setting = ":os", @@ -42,3 +32,32 @@ constraint_value( name = "windows", constraint_setting = ":os", ) + +### Apple OS Values + +constraint_value( + name = "ios", + constraint_setting = ":os", +) + +constraint_value( + name = "macos", + constraint_setting = ":os", +) + +# TODO(b/138656886): Migrate current usages of +# //os:osx to :macos instead. +alias( + name = "osx", + actual = ":macos", +) + +constraint_value( + name = "tvos", + constraint_setting = ":os", +) + +constraint_value( + name = "watchos", + constraint_setting = ":os", +)