blob: 2d12753634679aa0f380b03699d3ede235ab12b1 [file] [log] [blame]
David Tolnay5bde59d2020-02-09 18:59:12 -08001rust_library(
2 name = "cxx",
3 srcs = glob(["src/**"]),
4 visibility = ["PUBLIC"],
5 deps = [
6 ":core",
7 ":macro",
8 "//third-party:anyhow",
9 "//third-party:cc",
10 "//third-party:codespan",
11 "//third-party:codespan-reporting",
12 "//third-party:link-cplusplus",
13 "//third-party:proc-macro2",
14 "//third-party:quote",
15 "//third-party:syn",
16 "//third-party:thiserror",
17 ],
18)
19
20rust_binary(
21 name = "codegen",
22 srcs = glob(["cmd/src/**"]),
23 visibility = ["PUBLIC"],
24 env = {
25 "CARGO_PKG_AUTHORS": "David Tolnay <dtolnay@gmail.com>",
26 },
27 deps = [
28 "//third-party:anyhow",
29 "//third-party:codespan",
30 "//third-party:codespan-reporting",
31 "//third-party:proc-macro2",
32 "//third-party:quote",
33 "//third-party:structopt",
34 "//third-party:syn",
35 "//third-party:thiserror",
36 ],
37)
38
39cxx_library(
40 name = "core",
41 srcs = ["src/cxxbridge.cc"],
42 visibility = ["PUBLIC"],
43 header_namespace = "cxxbridge",
44 exported_headers = {
45 "cxxbridge.h": "include/cxxbridge.h",
46 },
47 exported_linker_flags = ["-lstdc++"],
48)
49
50rust_library(
51 name = "macro",
52 srcs = glob(["macro/src/**"]),
53 proc_macro = True,
54 crate = "cxxbridge_macro",
55 deps = [
56 "//third-party:proc-macro2",
57 "//third-party:quote",
58 "//third-party:syn",
59 ],
60)