From 907f56a1559f5400d7d56d535b46943732a8e678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 6 Aug 2021 14:33:30 +0300 Subject: [PATCH] add onboarding instructions --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a4a197..1356468 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,25 @@ This is an early stage zig-cc toolchain that can cross-compile cgo programs to t # Usage -Add this to your `WORKSPACE`: TBD. +Add this to your `WORKSPACE`: + +``` +BAZEL_ZIG_CC_VERSION = "0.2" + +http_archive( + name = "bazel-zig-cc", + sha256 = "0af0493e2d4822a94803e8a83703d25e0f9d8fe6ec4daf3b0ed3ca4cd6076650", + 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_register_toolchains = "register_toolchains") + +zig_register_toolchains() +``` + +This will register the "default" toolchains. Look into `register_toolchains` on +which parameters it accepts. # Testing