mirror of
https://github.com/google/go-jsonnet.git
synced 2025-10-02 19:01:03 +02:00
Allow building the "c-bindings" program with Bazel
This commit is contained in:
parent
e7f9dcae99
commit
886fcaca1d
@ -1,5 +1,10 @@
|
||||
workspace(name = "google_jsonnet_go")
|
||||
|
||||
local_repository(
|
||||
name = "cpp_jsonnet",
|
||||
path = "./cpp-jsonnet",
|
||||
)
|
||||
|
||||
load(
|
||||
"@bazel_tools//tools/build_defs/repo:http.bzl",
|
||||
"http_archive",
|
||||
|
@ -9,11 +9,17 @@ go_library(
|
||||
"json.h",
|
||||
"libjsonnet.cpp",
|
||||
],
|
||||
cdeps = [
|
||||
"@cpp_jsonnet//include:libjsonnet",
|
||||
],
|
||||
cgo = True,
|
||||
copts = ["-std=c++11 -Wall"],
|
||||
copts = ["-Wall -Icpp-jsonnet/include"], # keep
|
||||
cxxopts = ["-std=c++11"],
|
||||
importpath = "github.com/google/go-jsonnet/c-bindings",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = ["//:go_default_library"],
|
||||
deps = [
|
||||
"//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/google/go-jsonnet"
|
||||
|
||||
// #cgo CXXFLAGS: -std=c++11 -Wall
|
||||
// #cgo CXXFLAGS: -std=c++11 -Wall -I../cpp-jsonnet/include
|
||||
// #include "internal.h"
|
||||
"C"
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
extern "C" {
|
||||
#include "../cpp-jsonnet/include/libjsonnet.h"
|
||||
#include "libjsonnet.h"
|
||||
}
|
||||
|
||||
#include "json.h"
|
||||
|
@ -22,8 +22,6 @@ limitations under the License.
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "../cpp-jsonnet/include/libjsonnet.h"
|
||||
|
||||
struct JsonnetJsonValue {
|
||||
enum Kind {
|
||||
ARRAY,
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
extern "C" {
|
||||
#include "../cpp-jsonnet/include/libjsonnet.h"
|
||||
#include "libjsonnet.h"
|
||||
#include "internal.h"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user