~motiejus/bazel-zig-cc

ref: ea14601308340df78dd1d508caa322f174fd4582 bazel-zig-cc/test/BUILD -rw-r--r-- 606 bytes
ea146013 — Motiejus Jakštys fix workspace name #2 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "go_lib",
    srcs = ["hello.go"],
    cgo = True,
    importpath = "github.com/motiejus/bazel-zig-cc/test",
    visibility = ["//visibility:private"],
)

go_binary(
    name = "gognu",
    embed = [":go_lib"],
    visibility = ["//visibility:public"],
)

go_binary(
    name = "gomusl",
    embed = [":go_lib"],
    static = "on",
    target_compatible_with = select({
        "@platforms//os:linux": ["@zig_sdk//:libc_musl"],
        "//conditions:default": [],
    }),
    visibility = ["//visibility:public"],
)