Support linking Rust code into a C++ binary
This is based on a version of my upstream PR:
https://github.com/bazelbuild/rules_rust/pull/1350
Change-Id: Ica7097c10666d2e0017336cf7d81420605238493
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
diff --git a/build_tests/BUILD b/build_tests/BUILD
index 29a1275..24fdad8 100644
--- a/build_tests/BUILD
+++ b/build_tests/BUILD
@@ -178,3 +178,16 @@
target_compatible_with = ["@platforms//os:linux"],
deps = [":ts_test"],
)
+
+rust_library(
+ name = "rust_in_cc_rs",
+ srcs = ["rust_in_cc.rs"],
+ target_compatible_with = ["@platforms//os:linux"],
+)
+
+cc_test(
+ name = "rust_in_cc",
+ srcs = ["rust_in_cc.cc"],
+ target_compatible_with = ["@platforms//os:linux"],
+ deps = [":rust_in_cc_rs"],
+)