2023-01-09 20:42:51 +03:00
|
|
|
load("//bazel:common_settings.bzl", "string_flag")
|
|
|
|
|
2023-01-09 19:28:47 +03:00
|
|
|
#
|
|
|
|
# OS-CPU CONFIG SETTINGS
|
|
|
|
#
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "linux_arm64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:linux",
|
|
|
|
"@platforms//cpu:arm64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "linux_x86_64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:linux",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "macos_arm64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:macos",
|
|
|
|
"@platforms//cpu:arm64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "macos_x86_64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:macos",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "openbsd_x86_64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:openbsd",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2023-01-09 20:42:51 +03:00
|
|
|
name = "windows_x86_64",
|
2023-01-09 19:28:47 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:windows",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
#
|
2023-01-09 20:42:51 +03:00
|
|
|
# COMPILERS
|
2023-01-09 19:28:47 +03:00
|
|
|
#
|
|
|
|
|
2023-01-09 20:42:51 +03:00
|
|
|
# Version flag for clang.
|
|
|
|
string_flag(
|
|
|
|
name = "clang_version",
|
2023-01-09 21:54:11 +03:00
|
|
|
# macOS uses `clang-14.0.0` by default.
|
|
|
|
build_setting_default = "14.0.0",
|
2023-01-09 20:42:51 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Version flag for gcc.
|
|
|
|
string_flag(
|
|
|
|
name = "gcc_version",
|
2023-01-09 21:54:11 +03:00
|
|
|
# musl-cross-make uses `gcc-9.4.0` by default.
|
|
|
|
build_setting_default = "9.4.0",
|
2023-01-09 20:42:51 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2023-01-09 19:28:47 +03:00
|
|
|
#
|
|
|
|
# PLATFORMS
|
|
|
|
#
|
2023-01-09 20:42:51 +03:00
|
|
|
# A platform takes one of two formats: `<compiler>-<os>-<cpu>` or `<os>-<cpu>`
|
|
|
|
# if the compiler is unspecified.
|
|
|
|
|
|
|
|
# Linux arm64 platform with unspecified compiler.
|
|
|
|
platform(
|
|
|
|
name = "linux-arm64",
|
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:linux",
|
|
|
|
"@platforms//cpu:arm64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Linux x86_64 platform with unspecified compiler.
|
|
|
|
platform(
|
|
|
|
name = "linux-x86_64",
|
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:linux",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Linux x86_64 platform with gcc.
|
2023-01-09 19:28:47 +03:00
|
|
|
platform(
|
|
|
|
name = "gcc-linux-x86_64",
|
|
|
|
constraint_values = [
|
|
|
|
":gcc",
|
|
|
|
"@platforms//os:linux",
|
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2023-01-09 21:05:24 +03:00
|
|
|
platform(
|
|
|
|
name = "macos-arm64",
|
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:macos",
|
|
|
|
"@platforms//cpu:arm64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2023-01-09 21:03:58 +03:00
|
|
|
platform(
|
|
|
|
name = "clang-macos-arm64",
|
|
|
|
constraint_values = [
|
|
|
|
":clang",
|
|
|
|
"@platforms//os:macos",
|
|
|
|
"@platforms//cpu:arm64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
platform(
|
2023-01-09 21:05:24 +03:00
|
|
|
name = "macos-x86_64",
|
2023-01-09 21:03:58 +03:00
|
|
|
constraint_values = [
|
|
|
|
"@platforms//os:macos",
|
2023-01-09 21:05:24 +03:00
|
|
|
"@platforms//cpu:x86_64",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
platform(
|
|
|
|
name = "clang-macos-x86_64",
|
|
|
|
constraint_values = [
|
|
|
|
":clang",
|
|
|
|
"@platforms//os:macos",
|
|
|
|
"@platforms//cpu:x86_64",
|
2023-01-09 21:03:58 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2023-01-09 19:28:47 +03:00
|
|
|
alias(
|
|
|
|
name = "urbit",
|
|
|
|
actual = "//pkg/vere:urbit",
|
|
|
|
)
|