2021-06-07 23:17:19 +03:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
|
|
|
|
|
|
|
go_library(
|
2021-06-19 16:32:07 +03:00
|
|
|
name = "hello_lib",
|
2021-06-07 23:17:19 +03:00
|
|
|
srcs = ["hello.go"],
|
|
|
|
cgo = True,
|
|
|
|
importpath = "github.com/motiejus/bazel-zig-cc/test",
|
|
|
|
visibility = ["//visibility:private"],
|
2021-07-21 15:02:04 +03:00
|
|
|
deps = [
|
|
|
|
"@com_github_datadog_zstd//:go_default_library",
|
|
|
|
"@com_github_mattn_go_sqlite3//:go_default_library",
|
|
|
|
],
|
2021-06-07 23:17:19 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
go_binary(
|
2021-06-19 16:32:07 +03:00
|
|
|
name = "hello",
|
|
|
|
embed = [":hello_lib"],
|
2021-06-16 14:44:57 +03:00
|
|
|
gc_linkopts = select({
|
2021-06-19 16:32:07 +03:00
|
|
|
"@platforms//os:macos": [
|
|
|
|
"-s",
|
|
|
|
"-w",
|
|
|
|
"-buildmode=pie",
|
|
|
|
],
|
2021-06-16 14:44:57 +03:00
|
|
|
"//conditions:default": [],
|
|
|
|
}),
|
2021-06-07 23:17:19 +03:00
|
|
|
static = "on",
|
|
|
|
visibility = ["//visibility:public"],
|
2021-04-10 01:05:01 +03:00
|
|
|
)
|