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", "internal.h",
"libjsonnet.cpp", "libjsonnet.cpp",
], ],
cdeps = [
"@cpp_jsonnet//include:libjsonnet",
],
cgo = True, cgo = True,
copts = ["-Wall -Icpp-jsonnet/include"], # keep copts = ["-Wall"], # keep
cxxopts = ["-std=c++11 -Wall -Icpp-jsonnet/include"], cxxopts = ["-std=c++11 -Wall"],
importpath = "github.com/google/go-jsonnet/c-bindings", importpath = "github.com/google/go-jsonnet/c-bindings",
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [ deps = [

View File

@ -10,7 +10,7 @@ import (
"github.com/google/go-jsonnet/ast" "github.com/google/go-jsonnet/ast"
"github.com/google/go-jsonnet/formatter" "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" // #include "internal.h"
"C" "C"
) )

View File

@ -2,7 +2,10 @@
#include <stdlib.h> #include <stdlib.h>
extern "C" { 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" #include "internal.h"
} }