xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/bindgen/BUILD.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1load("@rules_rust//bindgen:defs.bzl", "rust_bindgen_library")
2load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test")
3
4rust_bindgen_library(
5    name = "simple_bindgen",
6    bindgen_flags = [
7        "--allowlist-function=simple_.*",
8        "--allowlist-var=SIMPLE_.*",
9    ],
10    cc_lib = "//bindgen/simple",
11    header = "//bindgen/simple:simple.h",
12    wrap_static_fns = True,
13)
14
15rust_binary(
16    name = "simple_example",
17    srcs = ["main.rs"],
18    deps = [":simple_bindgen"],
19)
20
21rust_test(
22    name = "simple_test",
23    crate = ":simple_example",
24)
25