test-zig-cc/WORKSPACE

70 lines
2.4 KiB
Python
Raw Normal View History

2022-10-19 11:35:55 +03:00
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
## LLVM-14
BAZEL_TOOLCHAIN_TAG = "0.7.2"
BAZEL_TOOLCHAIN_SHA = "f7aa8e59c9d3cafde6edb372d9bd25fb4ee7293ab20b916d867cd0baaa642529"
http_archive(
name = "com_grail_bazel_toolchain",
sha256 = BAZEL_TOOLCHAIN_SHA,
strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG),
canonical_id = BAZEL_TOOLCHAIN_TAG,
url = "https://github.com/grailbio/bazel-toolchain/archive/{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG),
)
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
bazel_toolchain_dependencies()
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "14.0.0",
)
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
#llvm_register_toolchains()
### ZIG
2022-11-21 06:18:35 +02:00
BAZEL_ZIG_CC_VERSION = "88e7e47ed20ca7b2f9509dfe09089b812d7d94eb"
2022-10-19 11:35:55 +03:00
http_archive(
name = "bazel-zig-cc",
2022-11-21 06:18:35 +02:00
sha256 = "2a9dd119243899041279b61066a98b53d6859e168f7fc3be0cc9532fa329fc68",
2022-10-19 11:35:55 +03:00
strip_prefix = "bazel-zig-cc-{}".format(BAZEL_ZIG_CC_VERSION),
urls = [
"https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.tar.gz".format(BAZEL_ZIG_CC_VERSION),
],
)
load("@bazel-zig-cc//toolchain:defs.bzl", zig_toolchains = "toolchains")
zig_toolchains(
host_platform_sha256 = {
2022-11-29 16:14:16 +02:00
"linux-aarch64": "9d85f451e06eb246ba6ac11c20ea988f38de078e31c922b7919c599d097dcc17",
"linux-x86_64": "b8c2876d7012234b99dc0d772a39ef3223d65a20acd0d061c4be692375220af0",
"macos-aarch64": "50a7bf17e36f677d994f18f021fb8cdcd17faceb8504994a1083888601059606",
"macos-x86_64": "90360f529b8e103ac3538de9a27835bfb37a9f6b4b1e5581bcb23ec2c4cac2e6",
"windows-x86_64": "87669cc8bda2c6eef0f3c298ddd545d495e1d3554b787bd7ccbca144c5ef729a",
},
url_formats = [
"https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{_ext}",
],
2022-11-29 16:14:16 +02:00
version = "0.11.0-dev.324+f61c5f3f5",
)
2022-10-19 11:35:55 +03:00
register_toolchains(
# amd64 toolchains for libc-aware platforms:
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.19",
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.28",
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.31",
"@zig_sdk//libc_aware/toolchain:linux_amd64_musl",
# arm64 toolchains for libc-aware platforms:
"@zig_sdk//libc_aware/toolchain:linux_arm64_gnu.2.28",
"@zig_sdk//libc_aware/toolchain:linux_arm64_musl",
)