blob: 05f3b32f5fa5794518b48e90b0258dfd4d8a37dd [file] [log] [blame]
// 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: "android",
rustlibs: [
"libciborium",
"libciborium_io",
"libcoset",
"libder",
"libkmr_wire",
"liblog_rust",
"libpkcs1",
"libpkcs8",
"libsec1",
"libspki",
"libzeroize",
],
proc_macros: [
"libenumn",
"libkmr_derive",
],
}
rust_library {
name: "libkmr_common",
crate_name: "kmr_common",
srcs: ["src/lib.rs"],
host_supported: true,
vendor_available: true,
defaults: [
"kmr_common_defaults",
],
}
rust_library_rlib {
name: "libkmr_common_nostd",
crate_name: "kmr_common",
srcs: ["src/lib.rs"],
edition: "2021",
lints: "android",
vendor_available: true,
prefer_rlib: true,
no_stdlibs: true,
rustlibs: [
"libciborium_nostd",
"libciborium_io_nostd",
"libcoset_nostd",
"libder_nostd",
"libkmr_wire_nostd",
"liblog_rust_nostd",
"libpkcs1_nostd",
"libpkcs8_nostd",
"libsec1_nostd",
"libspki_nostd",
"libzeroize_nostd",
],
proc_macros: [
"libenumn",
"libkmr_derive",
],
stdlibs: [
"liballoc.rust_sysroot",
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
}
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",
],
}
// The fuzzer target cannot be built for the device because some
// of the dependencies have restricted visibility.
rust_fuzz_host {
name: "libkmr_common_fuzz_keyblob",
srcs: ["fuzz/fuzz_targets/keyblob.rs"],
rustlibs: ["libkmr_common"],
fuzz_config: {
cc: ["drysdale@google.com", "hasinitg@google.com"],
componentid: 1084733,
hotlists: ["4271696"],
fuzz_on_haiku_device: false,
fuzz_on_haiku_host: true,
},
}