blob: 2f80c9b032d7a449ac9ac65974e12968a023cb1b [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",
David Tolnay736cbca2020-03-11 16:49:18 -070041 srcs = ["src/cxx.cc"],
David Tolnay5bde59d2020-02-09 18:59:12 -080042 visibility = ["PUBLIC"],
David Tolnay736cbca2020-03-11 16:49:18 -070043 header_namespace = "rust",
David Tolnay5bde59d2020-02-09 18:59:12 -080044 exported_headers = {
David Tolnay736cbca2020-03-11 16:49:18 -070045 "cxx.h": "include/cxx.h",
David Tolnay5bde59d2020-02-09 18:59:12 -080046 },
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)