xref: /aosp_15_r20/system/keymint/boringssl/Android.bp (revision 9860b7637a5f185913c70aa0caabe3ecb78441e4)
1// Copyright 2022, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["system_keymint_license"],
17}
18
19rust_defaults {
20    name: "libkmr_crypto_boring_defaults",
21    edition: "2021",
22    lints: "android",
23    rustlibs: [
24        "libbssl_sys",
25        "libforeign_types",
26        "liblibc",
27        "liblog_rust",
28        "libkmr_common",
29        "libkmr_wire",
30        "libopenssl",
31    ],
32    cfgs: [
33        // cfg(soong) is used to distinguish code that only builds on Android, so
34        // that (most of) the same code can be built under both Soong and cargo.
35        "soong",
36    ],
37}
38
39rust_library {
40    name: "libkmr_crypto_boring",
41    crate_name: "kmr_crypto_boring",
42    srcs: ["src/lib.rs"],
43    vendor_available: true,
44    host_supported: true,
45    defaults: [
46        "libkmr_crypto_boring_defaults",
47    ],
48}
49
50rust_test_host {
51    name: "libkmr_crypto_boring_test",
52    srcs: ["src/lib.rs"],
53    rustlibs: [
54        "libkmr_tests",
55    ],
56    defaults: [
57        "libkmr_crypto_boring_defaults",
58    ],
59    test_suites: ["general-tests"],
60}
61