1
hermetic_cc_toolchain/test/go/BUILD
2021-06-07 23:00:32 +03:00

22 lines
584 B
Python

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
# go build -ldflags "-linkmode external -extldflags -static" hello.go
go_library(
name = "go_lib",
srcs = ["hello.go"],
cgo = True,
importpath = "github.com/motiejus/bazel-zig-cc/test/go",
visibility = ["//visibility:private"],
target_compatible_with = select({
"@platforms//os:linux": ["@com_github_ziglang_zig//:musl"],
"//conditions:default": [],
}),
)
go_binary(
name = "go",
embed = [":go_lib"],
visibility = ["//visibility:public"],
static = "on",
)