summaryrefslogtreecommitdiff
path: root/bazel/configurability.go
diff options
context:
space:
mode:
Diffstat (limited to 'bazel/configurability.go')
-rw-r--r--bazel/configurability.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/bazel/configurability.go b/bazel/configurability.go
index 1993f76fc..7355ac7d3 100644
--- a/bazel/configurability.go
+++ b/bazel/configurability.go
@@ -109,6 +109,21 @@ var (
osArchWindowsX86_64: "//build/bazel/platforms/os_arch:windows_x86_64",
ConditionsDefaultConfigKey: ConditionsDefaultSelectKey, // The default condition of an os select map.
}
+
+ // Map where keys are OsType names, and values are slices containing the archs
+ // that that OS supports.
+ // These definitions copied from arch.go.
+ // TODO(cparsons): Source from arch.go; this task is nontrivial, as it currently results
+ // in a cyclic dependency.
+ osToArchMap = map[string][]string{
+ osAndroid: {archArm, archArm64, archX86, archX86_64},
+ osLinux: {archX86, archX86_64},
+ osLinuxMusl: {archX86, archX86_64},
+ osDarwin: {archArm64, archX86_64},
+ osLinuxBionic: {archArm64, archX86_64},
+ // TODO(cparsons): According to arch.go, this should contain archArm, archArm64, as well.
+ osWindows: {archX86, archX86_64},
+ }
)
// basic configuration types
@@ -122,6 +137,10 @@ const (
productVariables
)
+func osArchString(os string, arch string) string {
+ return fmt.Sprintf("%s_%s", os, arch)
+}
+
func (ct configurationType) String() string {
return map[configurationType]string{
noConfig: "no_config",