Skip to content

Commit 2f73f61

Browse files
eagletmtjohnbartholomew
authored andcommitted
Remove dependency on cpp-jsonnet submodule from C bindings
This change allows us to build libgojsonnet from tarball downloaded from GitHub releases.
1 parent 1c79f57 commit 2f73f61

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

c-bindings/BUILD.bazel

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ go_library(
1717
"internal.h",
1818
"libjsonnet.cpp",
1919
],
20-
cdeps = [
21-
"@cpp_jsonnet//include:libjsonnet",
22-
],
2320
cgo = True,
24-
copts = ["-Wall -Icpp-jsonnet/include"], # keep
25-
cxxopts = ["-std=c++11 -Wall -Icpp-jsonnet/include"],
21+
copts = ["-Wall"], # keep
22+
cxxopts = ["-std=c++11 -Wall"],
2623
importpath = "github.com/google/go-jsonnet/c-bindings",
2724
visibility = ["//visibility:private"],
2825
deps = [

c-bindings/c-bindings.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/google/go-jsonnet/ast"
1111
"github.com/google/go-jsonnet/formatter"
1212

13-
// #cgo CXXFLAGS: -std=c++11 -Wall -I../cpp-jsonnet/include
13+
// #cgo CXXFLAGS: -std=c++11 -Wall
1414
// #include "internal.h"
1515
"C"
1616
)

c-bindings/libjsonnet.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
#include <stdlib.h>
33

44
extern "C" {
5-
#include "libjsonnet.h"
5+
void jsonnet_gc_min_objects(struct JsonnetVm *vm, unsigned v);
6+
void jsonnet_gc_growth_trigger(struct JsonnetVm *vm, double v);
7+
char *jsonnet_realloc(JsonnetVm *vm, char *str, size_t sz);
8+
69
#include "internal.h"
710
}
811

0 commit comments

Comments
 (0)