| package { |
| default_applicable_licenses: ["external_rust_crabbyavif_license"], |
| } |
| |
| license { |
| name: "external_rust_crabbyavif_license", |
| visibility: [":__subpackages__"], |
| license_kinds: [ |
| "SPDX-license-identifier-Apache-2.0", |
| ], |
| } |
| |
| rust_bindgen { |
| name: "libcrabbyavif_mediaimage2_bindgen", |
| crate_name: "crabbyavif_mediaimage2_bindgen", |
| wrapper_src: "sys/ndk-sys/mediaimage2_wrapper.hpp", |
| source_stem: "mediaimage2_bindgen", |
| header_libs: [ |
| "media_plugin_headers", |
| ], |
| bindgen_flags: [ |
| "--allowlist-item=android::MediaImage2?", |
| "--no-doc-comments", |
| "--no-layout-tests", |
| "--no-recursive-allowlist", |
| ], |
| } |
| |
| rust_bindgen { |
| name: "libcrabbyavif_ndk_bindgen", |
| crate_name: "crabbyavif_ndk_bindgen", |
| wrapper_src: "sys/ndk-sys/wrapper.h", |
| source_stem: "ndk_media_bindgen", |
| header_libs: [ |
| "libmediandk", |
| ], |
| bindgen_flags: [ |
| "--with-derive-default", |
| ], |
| } |
| |
| rust_library { |
| name: "libndk_sys", |
| crate_name: "ndk_sys", |
| cargo_env_compat: true, |
| cargo_pkg_version: "0.1.0", |
| cfgs: ["android_soong"], |
| srcs: [ |
| "sys/ndk-sys/src/lib.rs", |
| // This comment prevents bpfmt -s from sorting this list as lib.rs |
| // always has to be the first in the source list. |
| ":libcrabbyavif_ndk_bindgen", |
| ], |
| shared_libs: [ |
| "libmediandk", |
| ], |
| } |
| |
| rust_bindgen { |
| name: "libcrabbyavif_yuv_bindgen", |
| crate_name: "crabbyavif_yuv_bindgen", |
| wrapper_src: "sys/libyuv-sys/wrapper.h", |
| source_stem: "libyuv_bindgen", |
| product_available: true, |
| vendor_available: true, |
| header_libs: [ |
| "libyuv", |
| ], |
| } |
| |
| rust_library { |
| name: "liblibyuv_sys", |
| crate_name: "libyuv_sys", |
| cargo_env_compat: true, |
| cargo_pkg_version: "0.1.0", |
| cfgs: ["android_soong"], |
| srcs: [ |
| "sys/libyuv-sys/src/lib.rs", |
| // This comment prevents bpfmt -s from sorting this list as lib.rs |
| // always has to be the first in the source list. |
| ":libcrabbyavif_yuv_bindgen", |
| ], |
| whole_static_libs: [ |
| "libyuv", |
| ], |
| shared_libs: [ |
| "libc++", |
| "libjpeg", |
| ], |
| } |
| |
| rust_ffi_static { |
| name: "libcrabbyavif_ffi", |
| crate_name: "crabbyavif", |
| cargo_env_compat: true, |
| cargo_pkg_version: "0.1.0", |
| srcs: [ |
| "src/lib.rs", |
| // This comment prevents bpfmt -s from sorting this list as lib.rs |
| // always has to be the first in the source list. |
| ":libcrabbyavif_mediaimage2_bindgen", |
| ], |
| cfgs: ["android_soong"], |
| edition: "2021", |
| features: [ |
| "android_mediacodec", |
| "capi", |
| "heic", |
| "libyuv", |
| ], |
| rustlibs: [ |
| "liblibyuv_sys", |
| "liblog_rust", |
| "liblogger", |
| "libndk_sys", |
| "librustutils", |
| ], |
| shared_libs: [ |
| "libmediandk", |
| ], |
| include_dirs: ["include"], |
| apex_available: [ |
| "//apex_available:anyapex", |
| "//apex_available:platform", |
| ], |
| } |