2020-09-24 09:32:12 -04:00
|
|
|
load("//tools/buck:rust_cxx_bridge.bzl", "rust_cxx_bridge")
|
2020-09-22 01:27:30 -04:00
|
|
|
|
2020-02-22 22:46:03 -08:00
|
|
|
rust_test(
|
|
|
|
name = "test",
|
|
|
|
srcs = ["test.rs"],
|
2020-10-12 16:32:54 -07:00
|
|
|
deps = [
|
|
|
|
":ffi",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
2020-02-22 22:46:03 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
rust_library(
|
|
|
|
name = "ffi",
|
2020-05-08 02:16:29 -07:00
|
|
|
srcs = [
|
2020-10-10 16:19:20 -07:00
|
|
|
"ffi/extra.rs",
|
2020-05-08 02:16:29 -07:00
|
|
|
"ffi/lib.rs",
|
|
|
|
"ffi/module.rs",
|
|
|
|
],
|
2020-02-22 22:46:03 -08:00
|
|
|
crate = "cxx_test_suite",
|
|
|
|
deps = [
|
|
|
|
":impl",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cxx_library(
|
|
|
|
name = "impl",
|
|
|
|
srcs = [
|
|
|
|
"ffi/tests.cc",
|
2020-09-22 01:39:42 -04:00
|
|
|
":bridge/source",
|
2020-10-10 16:19:20 -07:00
|
|
|
":extra/source",
|
2020-10-10 16:29:58 -07:00
|
|
|
":module/source",
|
2020-02-22 22:46:03 -08:00
|
|
|
],
|
|
|
|
headers = {
|
2020-10-07 16:33:55 -07:00
|
|
|
"ffi/lib.rs.h": ":bridge/header",
|
|
|
|
"ffi/tests.h": "ffi/tests.h",
|
2020-02-22 22:46:03 -08:00
|
|
|
},
|
|
|
|
deps = ["//:core"],
|
|
|
|
)
|
|
|
|
|
2020-09-24 09:32:12 -04:00
|
|
|
rust_cxx_bridge(
|
|
|
|
name = "bridge",
|
|
|
|
src = "ffi/lib.rs",
|
2020-02-22 22:46:03 -08:00
|
|
|
)
|
|
|
|
|
2020-09-24 09:32:12 -04:00
|
|
|
rust_cxx_bridge(
|
2020-10-10 16:29:58 -07:00
|
|
|
name = "extra",
|
|
|
|
src = "ffi/extra.rs",
|
2020-02-22 22:46:03 -08:00
|
|
|
)
|
2020-10-10 16:19:20 -07:00
|
|
|
|
|
|
|
rust_cxx_bridge(
|
2020-10-10 16:29:58 -07:00
|
|
|
name = "module",
|
|
|
|
src = "ffi/module.rs",
|
2020-10-10 16:19:20 -07:00
|
|
|
)
|