1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_library {
6    name: "libcompos_verify_native_rust",
7    crate_name: "compos_verify_native",
8    defaults: ["avf_build_flags_rust"],
9    srcs: ["lib.rs"],
10    rustlibs: [
11        "libanyhow",
12        "libcxx",
13        "liblibc",
14    ],
15    static_libs: [
16        "libcompos_verify_native_cpp",
17        "libcompos_key",
18    ],
19    shared_libs: [
20        "libcrypto",
21    ],
22    apex_available: ["com.android.compos"],
23}
24
25cc_library_static {
26    name: "libcompos_verify_native_cpp",
27    defaults: ["avf_build_flags_cc"],
28    srcs: ["verify_native.cpp"],
29    static_libs: ["libcompos_key"],
30    shared_libs: [
31        "libbase",
32        "libcrypto",
33    ],
34    generated_headers: ["compos_verify_native_header"],
35    generated_sources: ["compos_verify_native_code"],
36    apex_available: ["com.android.compos"],
37}
38
39genrule {
40    name: "compos_verify_native_code",
41    tools: ["cxxbridge"],
42    cmd: "$(location cxxbridge) $(in) >> $(out)",
43    srcs: ["lib.rs"],
44    out: ["verify_native_cxx_generated.cc"],
45}
46
47genrule {
48    name: "compos_verify_native_header",
49    tools: ["cxxbridge"],
50    cmd: "$(location cxxbridge) $(in) --header >> $(out)",
51    srcs: ["lib.rs"],
52    out: ["lib.rs.h"],
53}
54