third_party_rust_cxx/tests/BUCK
2020-02-23 00:36:44 -08:00

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",
)