diff options
author | jcater <jcater@google.com> | 2018-03-27 07:22:35 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-27 07:24:16 -0700 |
commit | f5c8c0bb0f53cd7289d65672955b37ffcff7d6c4 (patch) | |
tree | 38a98d0407deee7cfec48557e20121b1f42c70a3 /tools/platforms | |
parent | 3c051758f69f78c4d0ca6500b7a82425dd542885 (diff) |
Add toolchain definitions for autoconfigured cc_toolchain entries.
PiperOrigin-RevId: 190611069
Diffstat (limited to 'tools/platforms')
-rw-r--r-- | tools/platforms/BUILD | 33 | ||||
-rw-r--r-- | tools/platforms/platforms.BUILD | 31 |
2 files changed, 64 insertions, 0 deletions
diff --git a/tools/platforms/BUILD b/tools/platforms/BUILD index 85bcef9070..4323b33544 100644 --- a/tools/platforms/BUILD +++ b/tools/platforms/BUILD @@ -1,3 +1,5 @@ +# Standard constraint_setting and constraint_values to be used in platforms. + package( default_visibility = ["//visibility:public"], ) @@ -51,11 +53,21 @@ constraint_value( ) constraint_value( + name = "ios", + constraint_setting = ":os", +) + +constraint_value( name = "freebsd", constraint_setting = ":os", ) constraint_value( + name = "android", + constraint_setting = ":os", +) + +constraint_value( name = "linux", constraint_setting = ":os", ) @@ -65,6 +77,21 @@ constraint_value( constraint_setting = ":os", ) +# A constraint that can only be matched by the autoconfigured platforms. +constraint_setting( + name = "autoconfigure_status", + visibility = ["//visibility:private"], +) + +constraint_value( + name = "autoconfigured", + constraint_setting = ":autoconfigure_status", + visibility = [ + "@bazel_tools//:__subpackages__", + "@local_config_cc//:__subpackages__", + ], +) + # A default platform with nothing defined. platform(name = "default_platform") @@ -72,6 +99,9 @@ platform(name = "default_platform") # internal build configurations, and so shouldn't be accessed by other packages. platform( name = "host_platform", + constraint_values = [ + ":autoconfigured", + ], cpu_constraints = [ ":x86_32", ":x86_64", @@ -90,6 +120,9 @@ platform( platform( name = "target_platform", + constraint_values = [ + ":autoconfigured", + ], cpu_constraints = [ ":x86_32", ":x86_64", diff --git a/tools/platforms/platforms.BUILD b/tools/platforms/platforms.BUILD index e2ea57e811..5ff4ba804b 100644 --- a/tools/platforms/platforms.BUILD +++ b/tools/platforms/platforms.BUILD @@ -41,11 +41,21 @@ constraint_value( ) constraint_value( + name = "ios", + constraint_setting = ":os", +) + +constraint_value( name = "freebsd", constraint_setting = ":os", ) constraint_value( + name = "android", + constraint_setting = ":os", +) + +constraint_value( name = "linux", constraint_setting = ":os", ) @@ -55,6 +65,21 @@ constraint_value( constraint_setting = ":os", ) +# A constraint that can only be matched by the autoconfigured platforms. +constraint_setting( + name = "autoconfigure_status", + visibility = ["//visibility:private"], +) + +constraint_value( + name = "autoconfigured", + constraint_setting = ":autoconfigure_status", + visibility = [ + "@bazel_tools//:__subpackages__", + "@local_config_cc//:__subpackages__", + ], +) + # A default platform with nothing defined. platform(name = "default_platform") @@ -62,6 +87,9 @@ platform(name = "default_platform") # internal build configurations, and so shouldn't be accessed by other packages. platform( name = "host_platform", + constraint_values = [ + ":autoconfigured", + ], cpu_constraints = [ ":x86_32", ":x86_64", @@ -80,6 +108,9 @@ platform( platform( name = "target_platform", + constraint_values = [ + ":autoconfigured", + ], cpu_constraints = [ ":x86_32", ":x86_64", |