mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-08 07:17:12 +02:00
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
|
|
|
# If you run `go build` a header "libgojsonnet.h" will be autogenerated in
|
|
# this directory. Then it can be picked up by Gazelle and added to `srcs` here.
|
|
# When building with Bazel the file gets created elsewhere in Bazel's
|
|
# sandbox tree, so when using Bazel exclusively it won't cause any trouble.
|
|
# However, sooner or later someone is going to run Gazelle after using `go build`
|
|
# and then the file may slip in, so it's better to just exclude it explicitly,
|
|
# with the directive below:
|
|
# gazelle:exclude ./libgojsonnet.h
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
srcs = [
|
|
"c-bindings.go",
|
|
"handles.go",
|
|
"internal.h",
|
|
"libjsonnet.cpp",
|
|
],
|
|
cdeps = [
|
|
"@cpp_jsonnet//include:libjsonnet",
|
|
],
|
|
cgo = True,
|
|
copts = ["-Wall -Icpp-jsonnet/include"], # keep
|
|
cxxopts = ["-std=c++11 -Wall -Icpp-jsonnet/include"],
|
|
importpath = "github.com/google/go-jsonnet/c-bindings",
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
"//:go_default_library",
|
|
"//ast:go_default_library",
|
|
"//formatter:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_binary(
|
|
name = "c-bindings",
|
|
embed = [":go_default_library"],
|
|
visibility = ["//visibility:public"],
|
|
)
|