Remove dependency on cpp-jsonnet submodule from C bindings

This change allows us to build libgojsonnet from tarball downloaded from
GitHub releases.
This commit is contained in:
Kohei Suzuki 2020-11-25 00:48:58 +09:00 committed by John Bartholomew
parent 1c79f577ba
commit 2f73f6148f
3 changed files with 7 additions and 7 deletions

View File

@ -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 = [

View File

@ -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"
)

View File

@ -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"
}