1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3} 4 5rust_bindgen { 6 name: "libcap_bindgen", 7 defaults: ["avf_build_flags_rust"], 8 edition: "2021", 9 wrapper_src: "bindgen/libcap.h", 10 crate_name: "cap_bindgen", 11 source_stem: "bindings", 12 shared_libs: ["libcap"], 13 bindgen_flags: [ 14 "--default-enum-style rust", 15 ], 16 visibility: [ 17 "//packages/modules/Virtualization:__subpackages__", 18 ], 19} 20 21rust_test { 22 name: "libcap_bindgen_test", 23 srcs: [":libcap_bindgen"], 24 defaults: ["avf_build_flags_rust"], 25 crate_name: "cap_bindgen_test", 26 test_suites: ["general-tests"], 27 auto_gen_config: true, 28 clippy_lints: "none", 29 lints: "none", 30} 31 32rust_defaults { 33 name: "libcap_rust.defaults", 34 crate_name: "cap", 35 defaults: ["avf_build_flags_rust"], 36 srcs: ["src/caps.rs"], 37 rustlibs: [ 38 "libanyhow", 39 "libcap_bindgen", 40 "liblibc", 41 "libnix", 42 "libscopeguard", 43 ], 44 edition: "2021", 45 prefer_rlib: true, 46 multilib: { 47 lib32: { 48 enabled: false, 49 }, 50 }, 51 shared_libs: [ 52 "libcap", 53 ], 54} 55 56rust_library { 57 name: "libcap_rust", 58 defaults: ["libcap_rust.defaults"], 59} 60 61rust_test { 62 name: "libcap_rust.test", 63 defaults: ["libcap_rust.defaults"], 64 test_suites: ["general-tests"], 65} 66