1load("@rules_cc//cc:defs.bzl", "cc_library") 2load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") 3 4rust_library( 5 name = "rust-lib", 6 srcs = ["lib.rs"], 7 edition = "2021", 8) 9 10cc_library( 11 name = "c-lib", 12 srcs = ["api.c"], 13 deps = [":rust-lib"], 14) 15 16rust_binary( 17 name = "app", 18 srcs = ["main.rs"], 19 edition = "2021", 20 deps = [":c-lib"], 21) 22 23sh_test( 24 name = "test", 25 srcs = ["test.sh"], 26 args = ["$(location :app)"], 27 data = [":app"], 28 target_compatible_with = [ 29 "@platforms//os:macos", 30 ], 31) 32