1load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_static_library") 2load("//bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge") 3 4rust_binary( 5 name = "rust_hello_world", 6 srcs = ["hello-world.rs"], 7) 8 9rust_cxx_bridge( 10 name = "hype_bridge", 11 src = "hype-bridge.rs", 12) 13 14cc_binary( 15 name = "cpp_with_rust", 16 srcs = ["main.cpp"], 17 deps = [ 18 ":hype_bridge", 19 ":hype_lib", 20 ], 21) 22 23rust_static_library( 24 name = "hype_lib", 25 srcs = ["hype-bridge.rs"], 26 deps = ["@cxx"], 27) 28