1load("@rules_cc//cc:defs.bzl", "cc_library") 2load("//tools/bazel:rust.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 deps = [ 10 ":cxx_test_suite", 11 "//:cxx", 12 ], 13) 14 15rust_library( 16 name = "cxx_test_suite", 17 srcs = [ 18 "ffi/cast.rs", 19 "ffi/lib.rs", 20 "ffi/module.rs", 21 ], 22 deps = [ 23 ":impl", 24 "//:cxx", 25 ], 26) 27 28cc_library( 29 name = "impl", 30 srcs = [ 31 "ffi/tests.cc", 32 ":bridge/source", 33 ":module/source", 34 ], 35 hdrs = ["ffi/tests.h"], 36 deps = [ 37 ":bridge/include", 38 ":module/include", 39 "//:core", 40 ], 41) 42 43rust_cxx_bridge( 44 name = "bridge", 45 src = "ffi/lib.rs", 46 deps = [":impl"], 47) 48 49rust_cxx_bridge( 50 name = "module", 51 src = "ffi/module.rs", 52 deps = [":impl"], 53) 54