mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
43 lines
720 B
Python
43 lines
720 B
Python
rust_test(
|
|
name = "test",
|
|
srcs = ["test.rs"],
|
|
deps = [":ffi"],
|
|
)
|
|
|
|
rust_library(
|
|
name = "ffi",
|
|
srcs = ["ffi/lib.rs"],
|
|
crate = "cxx_test_suite",
|
|
deps = [
|
|
":impl",
|
|
"//:cxx",
|
|
],
|
|
)
|
|
|
|
cxx_library(
|
|
name = "impl",
|
|
srcs = [
|
|
"ffi/tests.cc",
|
|
":gen-source",
|
|
],
|
|
headers = {
|
|
"ffi/lib.rs": ":gen-header",
|
|
"ffi/tests.h": "ffi/tests.h",
|
|
},
|
|
deps = ["//:core"],
|
|
)
|
|
|
|
genrule(
|
|
name = "gen-header",
|
|
srcs = ["ffi/lib.rs"],
|
|
cmd = "$(exe //:codegen) --header ${SRCS} > ${OUT}",
|
|
out = "gen.h",
|
|
)
|
|
|
|
genrule(
|
|
name = "gen-source",
|
|
srcs = ["ffi/lib.rs"],
|
|
cmd = "$(exe //:codegen) ${SRCS} > ${OUT}",
|
|
out = "gen.cc",
|
|
)
|