cxx/BUILD

81 lines
1.9 KiB
Python
Raw Normal View History

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
2020-02-22 19:48:47 +00:00
rust_library(
name = "cxx",
srcs = glob(["src/**/*.rs"]),
2020-07-31 05:26:52 +00:00
proc_macro_deps = [
":cxxbridge-macro",
],
2020-02-22 19:48:47 +00:00
visibility = ["//visibility:public"],
deps = [":core-lib"],
2020-02-22 19:48:47 +00:00
)
rust_binary(
name = "codegen",
2020-04-29 19:34:47 +00:00
srcs = glob(["gen/cmd/src/**/*.rs"]),
data = ["gen/cmd/src/gen/include/cxx.h"],
2020-02-22 19:48:47 +00:00
visibility = ["//visibility:public"],
deps = [
2020-07-31 05:39:23 +00:00
"//third-party:clap",
"//third-party:codespan-reporting",
"//third-party:proc-macro2",
2020-02-22 19:48:47 +00:00
"//third-party:quote",
"//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(
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_proc_macro(
name = "cxxbridge-macro",
2020-02-22 19:48:47 +00:00
srcs = glob(["macro/src/**"]),
deps = [
"//third-party:proc-macro2",
2020-02-22 19:48:47 +00:00
"//third-party:quote",
"//third-party:syn",
],
)
2020-04-29 19:34:47 +00:00
rust_library(
name = "build",
srcs = glob(["gen/build/src/**/*.rs"]),
data = ["gen/build/src/gen/include/cxx.h"],
visibility = ["//visibility:public"],
deps = [
"//third-party:cc",
"//third-party:codespan-reporting",
2020-10-08 23:43:19 +00:00
"//third-party:lazy_static",
2020-04-29 19:34:47 +00:00
"//third-party:proc-macro2",
"//third-party:quote",
2020-10-08 00:29:37 +00:00
"//third-party:scratch",
2020-04-29 19:34:47 +00:00
"//third-party:syn",
],
)
2020-08-25 00:58:36 +00:00
rust_library(
name = "lib",
srcs = glob(["gen/lib/src/**/*.rs"]),
2020-08-30 05:46:35 +00:00
data = ["gen/lib/src/gen/include/cxx.h"],
2020-08-25 00:58:36 +00:00
visibility = ["//visibility:public"],
deps = [
"//third-party:cc",
"//third-party:codespan-reporting",
"//third-party:proc-macro2",
"//third-party:quote",
"//third-party:syn",
],
)