• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: "vendor",
23    rustlibs: [
24        "libbssl_ffi",
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_host {
40    name: "libkmr_crypto_boring",
41    crate_name: "kmr_crypto_boring",
42    srcs: ["src/lib.rs"],
43    vendor_available: true,
44    defaults: [
45        "libkmr_crypto_boring_defaults",
46    ],
47}
48
49// TODO(b/204562227): Rust host unit tests work locally but fail in CI.
50//rust_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