Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions c-bindings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ go_library(
"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"],
copts = ["-Wall"], # keep
cxxopts = ["-std=c++11 -Wall"],
importpath = "github.com/google/go-jsonnet/c-bindings",
visibility = ["//visibility:private"],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion c-bindings/c-bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/google/go-jsonnet/ast"
"github.com/google/go-jsonnet/formatter"

// #cgo CXXFLAGS: -std=c++11 -Wall -I../cpp-jsonnet/include
// #cgo CXXFLAGS: -std=c++11 -Wall
// #include "internal.h"
"C"
)
Expand Down
5 changes: 4 additions & 1 deletion c-bindings/libjsonnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
#include <stdlib.h>

extern "C" {
#include "libjsonnet.h"
void jsonnet_gc_min_objects(struct JsonnetVm *vm, unsigned v);
void jsonnet_gc_growth_trigger(struct JsonnetVm *vm, double v);
char *jsonnet_realloc(JsonnetVm *vm, char *str, size_t sz);

#include "internal.h"
}

Expand Down