2020-02-25 08:07:13 +00:00
|
|
|
load("//tools/bazel:rust.bzl", "rust_binary", "rust_library")
|
2020-02-22 19:48:47 +00:00
|
|
|
|
|
|
|
rust_library(
|
|
|
|
name = "cxx",
|
|
|
|
srcs = glob(["src/**/*.rs"]),
|
2020-03-11 23:49:18 +00:00
|
|
|
data = ["src/gen/include/cxx.h"],
|
2020-02-22 19:48:47 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2020-02-25 00:46:55 +00:00
|
|
|
":core-lib",
|
|
|
|
":cxxbridge-macro",
|
2020-02-22 19:48:47 +00:00
|
|
|
"//third-party:anyhow",
|
|
|
|
"//third-party:cc",
|
2020-02-25 00:46:55 +00:00
|
|
|
"//third-party:codespan-reporting",
|
|
|
|
"//third-party:link-cplusplus",
|
|
|
|
"//third-party:proc-macro2",
|
2020-02-22 19:48:47 +00:00
|
|
|
"//third-party:quote",
|
|
|
|
"//third-party:syn",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
rust_binary(
|
|
|
|
name = "codegen",
|
|
|
|
srcs = glob(["cmd/src/**/*.rs"]),
|
2020-03-11 23:49:18 +00:00
|
|
|
data = ["cmd/src/gen/include/cxx.h"],
|
2020-02-22 19:48:47 +00:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//third-party:anyhow",
|
2020-02-25 00:46:55 +00:00
|
|
|
"//third-party:codespan-reporting",
|
|
|
|
"//third-party:proc-macro2",
|
2020-02-22 19:48:47 +00:00
|
|
|
"//third-party:quote",
|
|
|
|
"//third-party:structopt",
|
|
|
|
"//third-party:syn",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "core",
|
2020-03-11 23:49:18 +00:00
|
|
|
hdrs = ["include/cxx.h"],
|
|
|
|
include_prefix = "rust",
|
2020-02-22 19:48:47 +00:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2020-02-25 00:46:55 +00:00
|
|
|
name = "core-lib",
|
2020-03-11 23:49:18 +00:00
|
|
|
srcs = ["src/cxx.cc"],
|
|
|
|
hdrs = ["include/cxx.h"],
|
2020-02-22 19:48:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
rust_library(
|
2020-02-25 00:46:55 +00:00
|
|
|
name = "cxxbridge-macro",
|
2020-02-22 19:48:47 +00:00
|
|
|
srcs = glob(["macro/src/**"]),
|
|
|
|
crate_type = "proc-macro",
|
|
|
|
deps = [
|
2020-02-25 00:46:55 +00:00
|
|
|
"//third-party:proc-macro2",
|
2020-02-22 19:48:47 +00:00
|
|
|
"//third-party:quote",
|
|
|
|
"//third-party:syn",
|
|
|
|
],
|
|
|
|
)
|