mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-12-12 09:25:36 +00:00
b110613bee
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
59 lines
937 B
Python
59 lines
937 B
Python
load("//tools/buck:rust_cxx_bridge.bzl", "rust_cxx_bridge")
|
|
|
|
rust_test(
|
|
name = "test",
|
|
srcs = ["test.rs"],
|
|
edition = "2018",
|
|
deps = [
|
|
":ffi",
|
|
"//:cxx",
|
|
],
|
|
)
|
|
|
|
rust_library(
|
|
name = "ffi",
|
|
srcs = [
|
|
"ffi/cast.rs",
|
|
"ffi/lib.rs",
|
|
"ffi/module.rs",
|
|
],
|
|
crate = "cxx_test_suite",
|
|
edition = "2018",
|
|
deps = [
|
|
":impl",
|
|
"//:cxx",
|
|
],
|
|
)
|
|
|
|
cxx_library(
|
|
name = "impl",
|
|
srcs = [
|
|
"ffi/tests.cc",
|
|
":bridge/source",
|
|
":module/source",
|
|
],
|
|
exported_deps = ["//:core"],
|
|
exported_headers = [
|
|
":bridge/header",
|
|
":module/header",
|
|
"ffi/tests.h",
|
|
],
|
|
preferred_linkage = "static",
|
|
)
|
|
|
|
rust_cxx_bridge(
|
|
name = "bridge",
|
|
src = "ffi/lib.rs",
|
|
deps = [
|
|
":impl",
|
|
],
|
|
)
|
|
|
|
rust_cxx_bridge(
|
|
name = "module",
|
|
src = "ffi/module.rs",
|
|
deps = [
|
|
":impl",
|
|
],
|
|
)
|