| // Copyright 2022, The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| package { |
| default_applicable_licenses: ["system_keymint_license"], |
| } |
| |
| rust_defaults { |
| name: "kmr_common_defaults", |
| edition: "2021", |
| lints: "vendor", |
| rustlibs: [ |
| "libciborium", |
| "libciborium_io", |
| "libcoset", |
| "libder", |
| "libkmr_wire", |
| "liblog_rust", |
| "libpkcs1", |
| "libpkcs8", |
| "libsec1", |
| "libspki", |
| "libzeroize", |
| ], |
| proc_macros: [ |
| "libenumn", |
| "libkmr_derive", |
| ], |
| } |
| |
| rust_library_host { |
| name: "libkmr_common", |
| crate_name: "kmr_common", |
| srcs: ["src/lib.rs"], |
| vendor_available: true, |
| defaults: [ |
| "kmr_common_defaults", |
| ], |
| } |
| |
| rust_test_host { |
| name: "libkmr_common_test", |
| crate_name: "kmr_common_test", |
| srcs: ["src/lib.rs"], |
| defaults: [ |
| "kmr_common_defaults", |
| ], |
| rustlibs: [ |
| "libhex", |
| ], |
| test_suites: ["general-tests"], |
| } |
| |
| rust_binary_host { |
| name: "kmr_cddl_dump", |
| crate_name: "kmr_cddl_dump", |
| srcs: ["src/bin/cddl-dump.rs"], |
| rustlibs: [ |
| "libkmr_common", |
| "libkmr_wire", |
| ], |
| } |
| |
| // Fuzz target is commented out because it must be built for the device, |
| // but some of the dependencies of libkmr_common have only been allowed as |
| // non-platform dependencies. |
| // TODO: reinstate if host-only fuzzing becomes available, or if the various |
| // dependencies become available on the platform |
| |
| //rust_fuzz { |
| // name: "libkmr_common_fuzz_keyblob", |
| // srcs: ["fuzz/fuzz_targets/keyblob.rs"], |
| // rustlibs: ["libkmr_common"], |
| //} |