• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1rust_library(
2    name = "cxx",
3    srcs = glob(["src/**/*.rs"]),
4    edition = "2018",
5    features = [
6        "alloc",
7        "std",
8    ],
9    visibility = ["PUBLIC"],
10    deps = [
11        ":core",
12        ":macro",
13    ],
14)
15
16rust_binary(
17    name = "codegen",
18    srcs = glob(["gen/cmd/src/**/*.rs"]) + [
19        "gen/cmd/src/gen",
20        "gen/cmd/src/syntax",
21    ],
22    crate = "cxxbridge",
23    edition = "2018",
24    visibility = ["PUBLIC"],
25    deps = [
26        "//third-party:clap",
27        "//third-party:codespan-reporting",
28        "//third-party:proc-macro2",
29        "//third-party:quote",
30        "//third-party:syn",
31    ],
32)
33
34cxx_library(
35    name = "core",
36    srcs = ["src/cxx.cc"],
37    exported_headers = {
38        "cxx.h": "include/cxx.h",
39    },
40    exported_linker_flags = ["-lstdc++"],
41    header_namespace = "rust",
42    visibility = ["PUBLIC"],
43)
44
45rust_library(
46    name = "macro",
47    srcs = glob(["macro/src/**/*.rs"]) + ["macro/src/syntax"],
48    crate = "cxxbridge_macro",
49    edition = "2018",
50    proc_macro = True,
51    deps = [
52        "//third-party:proc-macro2",
53        "//third-party:quote",
54        "//third-party:syn",
55    ],
56)
57
58rust_library(
59    name = "build",
60    srcs = glob(["gen/build/src/**/*.rs"]) + [
61        "gen/build/src/gen",
62        "gen/build/src/syntax",
63    ],
64    edition = "2018",
65    visibility = ["PUBLIC"],
66    deps = [
67        "//third-party:cc",
68        "//third-party:codespan-reporting",
69        "//third-party:once_cell",
70        "//third-party:proc-macro2",
71        "//third-party:quote",
72        "//third-party:scratch",
73        "//third-party:syn",
74    ],
75)
76
77rust_library(
78    name = "lib",
79    srcs = glob(["gen/lib/src/**/*.rs"]) + [
80        "gen/lib/src/gen",
81        "gen/lib/src/syntax",
82    ],
83    edition = "2018",
84    visibility = ["PUBLIC"],
85    deps = [
86        "//third-party:cc",
87        "//third-party:codespan-reporting",
88        "//third-party:proc-macro2",
89        "//third-party:quote",
90        "//third-party:syn",
91    ],
92)
93