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