• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_library")
2load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
3load("//tools/bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge")
4
5rust_test(
6    name = "test",
7    size = "small",
8    srcs = ["test.rs"],
9    edition = "2018",
10    deps = [
11        ":cxx_test_suite",
12        "//:cxx",
13    ],
14)
15
16rust_library(
17    name = "cxx_test_suite",
18    srcs = [
19        "ffi/cast.rs",
20        "ffi/lib.rs",
21        "ffi/module.rs",
22    ],
23    edition = "2018",
24    deps = [
25        ":impl",
26        "//:cxx",
27    ],
28)
29
30cc_library(
31    name = "impl",
32    srcs = [
33        "ffi/tests.cc",
34        ":bridge/source",
35        ":module/source",
36    ],
37    hdrs = ["ffi/tests.h"],
38    deps = [
39        ":bridge/include",
40        ":module/include",
41        "//:core",
42    ],
43)
44
45rust_cxx_bridge(
46    name = "bridge",
47    src = "ffi/lib.rs",
48    deps = [":impl"],
49)
50
51rust_cxx_bridge(
52    name = "module",
53    src = "ffi/module.rs",
54    deps = [":impl"],
55)
56