third_party_rust_cxx/demo-rs/BUCK

43 lines
756 B
Python
Raw Normal View History

2020-02-10 02:59:12 +00:00
rust_binary(
name = "demo-rs",
srcs = glob(["src/**"]),
deps = [
":gen",
"//:cxx",
"//demo-cxx:demo-cxx",
],
)
cxx_library(
name = "gen",
srcs = [":gen-source"],
deps = [
":include",
"//demo-cxx:include",
],
)
genrule(
name = "gen-header",
srcs = ["src/main.rs"],
out = "generated.h",
2020-02-10 02:59:12 +00:00
cmd = "$(exe //:codegen) --header ${SRCS} > ${OUT}",
type = "cxxbridge",
)
genrule(
name = "gen-source",
srcs = ["src/main.rs"],
out = "generated.cc",
2020-02-10 02:59:12 +00:00
cmd = "$(exe //:codegen) ${SRCS} > ${OUT}",
type = "cxxbridge",
)
cxx_library(
name = "include",
exported_headers = {
"src/main.rs.h": ":gen-header",
2020-02-10 02:59:12 +00:00
},
visibility = ["PUBLIC"],
)