add cgo example; fix zig url
This commit is contained in:
parent
5daa23e987
commit
5860621c80
7
BUILD
7
BUILD
@ -0,0 +1,7 @@
|
||||
load("@bazel_gazelle//:def.bzl", "gazelle")
|
||||
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
|
||||
|
||||
# gazelle:build_file_name BUILD
|
||||
gazelle(name = "gazelle")
|
||||
|
||||
buildifier(name = "buildifier")
|
@ -11,3 +11,5 @@ cc_binary(
|
||||
name = "exception",
|
||||
srcs = ["exception.cpp"],
|
||||
)
|
||||
|
||||
# go build -ldflags "-linkmode external -extldflags -static" hello.go
|
||||
|
9
test/hello.go
Normal file
9
test/hello.go
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
// #include <stdio.h>
|
||||
// void helloworld() { printf("hello, world\n"); }
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
C.helloworld()
|
||||
}
|
@ -82,7 +82,7 @@ def toolchain_repositories():
|
||||
name = "com_github_ziglang_zig",
|
||||
|
||||
version = "0.8.0",
|
||||
url_format = "https://ziglang.org/builds/zig-{host_platform}-{version}.tar.xz",
|
||||
url_format = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.tar.xz",
|
||||
host_platform_sha256 = {
|
||||
"linux-x86_64": "502625d3da3ae595c5f44a809a87714320b7a40e6dff4a895b5fa7df3391d01e",
|
||||
"macos-x86_64": "279f9360b5cb23103f0395dc4d3d0d30626e699b1b4be55e98fd985b62bc6fbe",
|
||||
|
Loading…
Reference in New Issue
Block a user