2020-09-24 12:56:48 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
2021-10-27 02:37:29 +00:00
|
|
|
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_proc_macro")
|
2020-02-22 19:48:47 +00:00
|
|
|
|
|
|
|
rust_library(
|
|
|
|
name = "cxx",
|
2020-09-08 05:26:46 +00:00
|
|
|
srcs = glob(["src/**/*.rs"]),
|
2021-12-07 22:49:41 +00:00
|
|
|
crate_features = [
|
|
|
|
"alloc",
|
|
|
|
"std",
|
|
|
|
],
|
2022-04-11 01:06:09 +00:00
|
|
|
edition = "2018",
|
2020-07-31 05:26:52 +00:00
|
|
|
proc_macro_deps = [
|
|
|
|
":cxxbridge-macro",
|
|
|
|
],
|
2020-02-22 19:48:47 +00:00
|
|
|
visibility = ["//visibility:public"],
|
2020-09-08 05:26:46 +00:00
|
|
|
deps = [":core-lib"],
|
2020-02-22 19:48:47 +00:00
|
|
|
)
|
|
|
|
|
2024-04-02 11:59:25 +00:00
|
|
|
alias(
|
2024-04-02 03:30:32 +00:00
|
|
|
name = "codegen",
|
2024-04-02 11:59:25 +00:00
|
|
|
actual = ":cxxbridge",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
rust_binary(
|
|
|
|
name = "cxxbridge",
|
2020-04-29 19:34:47 +00:00
|
|
|
srcs = glob(["gen/cmd/src/**/*.rs"]),
|
|
|
|
data = ["gen/cmd/src/gen/include/cxx.h"],
|
2022-04-11 01:06:09 +00:00
|
|
|
edition = "2018",
|
2020-02-22 19:48:47 +00:00
|
|
|
deps = [
|
2020-07-31 05:39:23 +00:00
|
|
|
"//third-party:clap",
|
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: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
|
|
|
)
|
|
|
|
|
2021-10-26 06:16:00 +00:00
|
|
|
rust_proc_macro(
|
2020-02-25 00:46:55 +00:00
|
|
|
name = "cxxbridge-macro",
|
2022-08-01 23:53:31 +00:00
|
|
|
srcs = glob(["macro/src/**/*.rs"]),
|
2022-04-11 01:06:09 +00:00
|
|
|
edition = "2018",
|
2020-02-22 19:48:47 +00:00
|
|
|
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",
|
|
|
|
],
|
|
|
|
)
|
2020-04-29 19:34:47 +00:00
|
|
|
|
|
|
|
rust_library(
|
2024-04-02 11:59:25 +00:00
|
|
|
name = "cxx-build",
|
2020-04-29 19:34:47 +00:00
|
|
|
srcs = glob(["gen/build/src/**/*.rs"]),
|
|
|
|
data = ["gen/build/src/gen/include/cxx.h"],
|
2022-04-11 01:06:09 +00:00
|
|
|
edition = "2018",
|
2020-04-29 19:34:47 +00:00
|
|
|
deps = [
|
|
|
|
"//third-party:cc",
|
|
|
|
"//third-party:codespan-reporting",
|
2022-01-03 09:15:51 +00:00
|
|
|
"//third-party:once_cell",
|
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(
|
2024-04-02 11:59:25 +00:00
|
|
|
name = "cxx-gen",
|
2020-08-25 00:58:36 +00:00
|
|
|
srcs = glob(["gen/lib/src/**/*.rs"]),
|
2020-08-30 05:46:35 +00:00
|
|
|
data = ["gen/lib/src/gen/include/cxx.h"],
|
2022-04-11 01:06:09 +00:00
|
|
|
edition = "2018",
|
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",
|
|
|
|
],
|
|
|
|
)
|