2019-06-06 09:18:26 +00:00
|
|
|
# Standard constraint_setting and constraint_values to be used in platforms.
|
|
|
|
licenses(["notice"])
|
|
|
|
|
|
|
|
package(
|
|
|
|
default_visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "srcs",
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
)
|
|
|
|
|
2019-06-18 18:15:05 +00:00
|
|
|
# To add a new constraint_value see https://github.com/bazelbuild/platforms.
|
2019-06-18 18:35:25 +00:00
|
|
|
constraint_setting(name = "os")
|
2019-06-06 09:18:26 +00:00
|
|
|
|
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "freebsd",
|
2019-06-06 09:18:26 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2021-09-16 08:22:39 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "netbsd",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-08-09 15:39:40 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "openbsd",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2022-05-09 16:07:44 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "haiku",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-06-06 09:18:26 +00:00
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "android",
|
2019-06-06 09:18:26 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "linux",
|
2019-06-06 09:18:26 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "windows",
|
2019-07-30 19:29:49 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2023-09-27 20:10:40 +00:00
|
|
|
# For the VXworks OS, usefull for embedded systems
|
|
|
|
constraint_value(
|
|
|
|
name = "vxworks",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-08-15 17:46:27 +00:00
|
|
|
# For platforms with no OS, like microcontrollers.
|
|
|
|
constraint_value(
|
|
|
|
name = "none",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-08-05 16:40:46 +00:00
|
|
|
### Apple OS Values
|
|
|
|
|
2019-07-30 19:29:49 +00:00
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "ios",
|
2019-07-30 19:29:49 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-08-05 16:40:46 +00:00
|
|
|
# TODO(b/138656886): Rename this to macos instead of osx.
|
2019-07-30 19:29:49 +00:00
|
|
|
constraint_value(
|
2019-08-05 16:40:46 +00:00
|
|
|
name = "osx",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-08-26 15:07:51 +00:00
|
|
|
alias(
|
|
|
|
name = "macos",
|
|
|
|
actual = ":osx",
|
|
|
|
)
|
|
|
|
|
2019-08-05 16:40:46 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "tvos",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
|
|
|
constraint_value(
|
|
|
|
name = "watchos",
|
2019-06-06 09:18:26 +00:00
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2019-11-05 16:03:21 +00:00
|
|
|
|
Add Apple visionos.
I'm not really satisified with this PR. The number of Apple specific platforms has grown to the point where we may want to refactor them. The question I would focus on is how various toolchain matches and select clauses go.
Do we see things like:
```
foo = select({
".../os:linux": A,
".../os:windows": B,
".../os:macos": C,
".../os:watchos": C,
".../os:visionos": C,
})
```
Where C is the same for all the apple platforms?
Or, do we see real distinctions across the various per-device OSes. Or a mix of both?
And, do we see the fanout of the Apple OSes done with a select_or wrapper, so users end up seeing the simple selection of just apple, linux, or windows, but we buried complexity elsewhere?
2023-06-26 14:58:38 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "visionos",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2019-11-05 16:03:21 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "qnx",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2019-12-30 16:53:47 +00:00
|
|
|
|
|
|
|
# NixOS uses the Linux kernel, but is not ABI-compatible with any
|
|
|
|
# other Linux distribution. This is because the dynamic linker is in
|
|
|
|
# a non-standard (and undefined) location on the filesystem.
|
|
|
|
constraint_value(
|
|
|
|
name = "nixos",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2020-11-05 05:24:03 +00:00
|
|
|
|
2024-01-09 17:32:47 +00:00
|
|
|
constraint_value(
|
|
|
|
name = "emscripten",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
|
|
|
|
2020-11-05 05:24:03 +00:00
|
|
|
# WASI (WebAssembly System Interface)
|
|
|
|
# https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-overview.md
|
|
|
|
constraint_value(
|
|
|
|
name = "wasi",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2021-11-09 18:44:49 +00:00
|
|
|
|
|
|
|
constraint_value(
|
|
|
|
name = "fuchsia",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2022-08-22 17:44:20 +00:00
|
|
|
|
|
|
|
constraint_value(
|
|
|
|
name = "chromiumos",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|
2024-07-25 14:03:19 +00:00
|
|
|
|
|
|
|
constraint_value(
|
|
|
|
name = "uefi",
|
|
|
|
constraint_setting = ":os",
|
|
|
|
)
|