• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//tools/buck:rust_cxx_bridge.bzl", "rust_cxx_bridge")
2
3rust_test(
4    name = "test",
5    srcs = ["test.rs"],
6    deps = [
7        ":ffi",
8        "//:cxx",
9    ],
10)
11
12rust_library(
13    name = "ffi",
14    srcs = [
15        "ffi/cast.rs",
16        "ffi/lib.rs",
17        "ffi/module.rs",
18    ],
19    crate = "cxx_test_suite",
20    deps = [
21        ":impl",
22        "//:cxx",
23    ],
24)
25
26cxx_library(
27    name = "impl",
28    srcs = [
29        "ffi/tests.cc",
30        ":bridge/source",
31        ":module/source",
32    ],
33    headers = {
34        "ffi/lib.rs.h": ":bridge/header",
35        "ffi/module.rs.h": ":module/header",
36        "ffi/tests.h": "ffi/tests.h",
37    },
38    deps = ["//:core"],
39)
40
41rust_cxx_bridge(
42    name = "bridge",
43    src = "ffi/lib.rs",
44)
45
46rust_cxx_bridge(
47    name = "module",
48    src = "ffi/module.rs",
49)
50