27fe6c9ffb
motiejus@mtwork:/code/bazel-zig-cc$ bazel build --spawn_strategy=local --platforms @zig_sdk//libc_aware/platform:macos_aarch64_sdk.13.1 test/c:which_libc INFO: Analyzed target //test/c:which_libc (0 packages loaded, 0 targets configured). INFO: Found 1 target... Target //test/c:which_libc up-to-date: bazel-bin/test/c/which_libc INFO: Elapsed time: 0.071s, Critical Path: 0.00s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action motiejus@mtwork:/code/bazel-zig-cc$ file bazel-bin/test/c/which_libc bazel-bin/test/c/which_libc: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE> motiejus@mtwork:/code/bazel-zig-cc$
97 lines
3.1 KiB
Python
97 lines
3.1 KiB
Python
workspace(
|
|
name = "bazel-zig-cc",
|
|
)
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
http_archive(
|
|
name = "io_bazel_rules_go",
|
|
sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
|
|
"https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
|
|
],
|
|
)
|
|
|
|
http_archive(
|
|
name = "bazel_gazelle",
|
|
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
|
|
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
|
|
],
|
|
)
|
|
|
|
load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
|
|
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
|
|
|
|
go_rules_dependencies()
|
|
|
|
# use latest stable.
|
|
go_download_sdk(
|
|
name = "go_sdk",
|
|
version = "1.20",
|
|
)
|
|
|
|
go_register_toolchains()
|
|
|
|
load("//:repositories.bzl", "go_repositories")
|
|
|
|
# gazelle:repository_macro repositories.bzl%go_repositories
|
|
go_repositories()
|
|
|
|
gazelle_dependencies(go_repository_default_config = "@//:WORKSPACE")
|
|
|
|
load(
|
|
"//toolchain:defs.bzl",
|
|
"macos_sdk",
|
|
zig_toolchains = "toolchains",
|
|
)
|
|
|
|
zig_toolchains(
|
|
macos_sdks = [
|
|
macos_sdk(
|
|
version = "13.1",
|
|
urls = [ "https://dl.jakstys.lt/ntpad/x/MacOSX13.1.sdk.tar.zst" ],
|
|
sha256 = "9b65f80a142dfb0b7d295636ad8b8f9b9b3450957f6d101f1076836463e729a9",
|
|
)
|
|
],
|
|
)
|
|
|
|
register_toolchains(
|
|
# if no `--platform` is specified, these toolchains will be used for
|
|
# (linux,darwin,windows)x(amd64,arm64)
|
|
"@zig_sdk//toolchain:linux_amd64_gnu.2.19",
|
|
"@zig_sdk//toolchain:linux_arm64_gnu.2.28",
|
|
"@zig_sdk//toolchain:darwin_amd64_sdk.13.1",
|
|
"@zig_sdk//toolchain:darwin_arm64_sdk.13.1",
|
|
"@zig_sdk//toolchain:windows_amd64",
|
|
"@zig_sdk//toolchain:windows_arm64",
|
|
|
|
# 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",
|
|
|
|
"@zig_sdk//libc_aware/toolchain:darwin_amd64_sdk.13.1",
|
|
"@zig_sdk//libc_aware/toolchain:darwin_arm64_sdk.13.1",
|
|
)
|
|
|
|
http_archive(
|
|
name = "com_google_protobuf",
|
|
sha256 = "d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113",
|
|
strip_prefix = "protobuf-3.14.0",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
|
|
"https://github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
|
|
],
|
|
)
|
|
|
|
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
|
|
|
|
protobuf_deps()
|