blob: 8bac94214b76f07b17481a932a69095ef43dcc48 [file] [log] [blame]
Jooyung Hanc8deb472021-09-13 13:48:25 +09001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_bindgen {
6 name: "libavb_bindgen",
Andrew Scull8e92a6e2022-04-11 17:09:41 +00007 host_supported: true,
Jooyung Hanc8deb472021-09-13 13:48:25 +09008 wrapper_src: "bindgen/avb.h",
9 crate_name: "avb_bindgen",
Alan Stokes6472ccd2022-08-31 13:41:28 +010010 edition: "2021",
Matthew Maurerf73794d2022-07-29 09:04:03 -070011 visibility: ["//packages/modules/Virtualization:__subpackages__"],
Jooyung Hanc8deb472021-09-13 13:48:25 +090012 source_stem: "bindings",
13 bindgen_flags: [
14 "--size_t-is-usize",
Alice Wangdc63fe02022-12-15 08:49:57 +000015 "--default-enum-style rust",
Jooyung Hanc8deb472021-09-13 13:48:25 +090016 "--allowlist-function=.*",
Alice Wang28cbcf12022-12-01 07:58:28 +000017 "--use-core",
18 "--raw-line=#![no_std]",
19 "--ctypes-prefix=core::ffi",
Jooyung Hanc8deb472021-09-13 13:48:25 +090020 ],
21 static_libs: [
22 "libavb",
23 ],
24 shared_libs: [
25 "libcrypto",
26 ],
27 cflags: ["-DBORINGSSL_NO_CXX"],
28}
29
30rust_test {
31 name: "libavb_bindgen_test",
32 srcs: [":libavb_bindgen"],
33 crate_name: "avb_bindgen_test",
Alan Stokes6472ccd2022-08-31 13:41:28 +010034 edition: "2021",
Jooyung Hanc8deb472021-09-13 13:48:25 +090035 test_suites: ["general-tests"],
36 auto_gen_config: true,
37 clippy_lints: "none",
38 lints: "none",
39}
Alice Wang28cbcf12022-12-01 07:58:28 +000040
41rust_library_rlib {
42 name: "libavb_nostd",
Alice Wang20982f72022-12-13 08:56:22 +000043 crate_name: "avb",
Alice Wang28cbcf12022-12-01 07:58:28 +000044 srcs: ["src/lib.rs"],
45 no_stdlibs: true,
46 prefer_rlib: true,
47 stdlibs: [
48 "libcore.rust_sysroot",
49 ],
50 rustlibs: [
51 "libavb_bindgen",
52 "liblog_rust_nostd",
53 ],
54}