2020-09-24 13:32:12 +00:00
|
|
|
load("//tools/buck:rust_cxx_bridge.bzl", "rust_cxx_bridge")
|
2020-09-22 05:27:30 +00:00
|
|
|
|
2020-02-23 06:46:03 +00:00
|
|
|
rust_test(
|
|
|
|
name = "test",
|
|
|
|
srcs = ["test.rs"],
|
2022-06-18 06:23:08 +00:00
|
|
|
edition = "2018",
|
2020-10-12 23:32:54 +00:00
|
|
|
deps = [
|
|
|
|
":ffi",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
2020-02-23 06:46:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
rust_library(
|
|
|
|
name = "ffi",
|
2020-05-08 09:16:29 +00:00
|
|
|
srcs = [
|
2020-11-26 03:56:09 +00:00
|
|
|
"ffi/cast.rs",
|
2020-05-08 09:16:29 +00:00
|
|
|
"ffi/lib.rs",
|
|
|
|
"ffi/module.rs",
|
|
|
|
],
|
2020-02-23 06:46:03 +00:00
|
|
|
crate = "cxx_test_suite",
|
2022-06-18 06:23:08 +00:00
|
|
|
edition = "2018",
|
2020-02-23 06:46:03 +00:00
|
|
|
deps = [
|
|
|
|
":impl",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cxx_library(
|
|
|
|
name = "impl",
|
|
|
|
srcs = [
|
|
|
|
"ffi/tests.cc",
|
2020-09-22 05:39:42 +00:00
|
|
|
":bridge/source",
|
2020-10-10 23:29:58 +00:00
|
|
|
":module/source",
|
2020-02-23 06:46:03 +00:00
|
|
|
],
|
2022-12-02 02:13:54 +00:00
|
|
|
exported_deps = ["//:core"],
|
2024-04-02 11:59:25 +00:00
|
|
|
exported_headers = [
|
|
|
|
":bridge/header",
|
|
|
|
":module/header",
|
|
|
|
"ffi/tests.h",
|
|
|
|
],
|
|
|
|
preferred_linkage = "static",
|
2020-02-23 06:46:03 +00:00
|
|
|
)
|
|
|
|
|
2020-09-24 13:32:12 +00:00
|
|
|
rust_cxx_bridge(
|
|
|
|
name = "bridge",
|
|
|
|
src = "ffi/lib.rs",
|
2022-12-02 02:13:54 +00:00
|
|
|
deps = [
|
|
|
|
":impl",
|
|
|
|
],
|
2020-02-23 06:46:03 +00:00
|
|
|
)
|
|
|
|
|
2020-10-10 23:19:20 +00:00
|
|
|
rust_cxx_bridge(
|
2020-10-10 23:29:58 +00:00
|
|
|
name = "module",
|
|
|
|
src = "ffi/module.rs",
|
2022-12-02 02:13:54 +00:00
|
|
|
deps = [
|
|
|
|
":impl",
|
|
|
|
],
|
2020-10-10 23:19:20 +00:00
|
|
|
)
|