xref: /aosp_15_r20/system/core/init/libprefetch/prefetch/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1//
2// Copyright (C) 2024 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_team: "trendy_team_android_kernel",
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21rust_library_rlib {
22    name: "libprefetch_rs",
23    crate_name: "prefetch_rs",
24    srcs: ["src/lib.rs"],
25    rustlibs: [
26        "libandroid_logger",
27        "libargh",
28        "libchrono",
29        "libcrc32fast",
30        "libcsv",
31        "liblibc",
32        "liblog_rust",
33        "liblru_cache",
34        "libnix",
35        "librand",
36        "librayon",
37        "libregex",
38        "libserde_cbor",
39        "libserde_json",
40        "libserde",
41        "libthiserror",
42        "libwalkdir",
43        "librustutils",
44    ],
45    prefer_rlib: true,
46    features: [
47        "derive",
48        "error-context",
49        "help",
50        "std",
51        "usage",
52        "use_argh",
53    ],
54}
55
56rust_binary {
57    name: "prefetch",
58    crate_name: "prefetch",
59    srcs: ["src/main.rs"],
60    rustlibs: [
61        "libprefetch_rs",
62        "liblog_rust",
63        "libandroid_logger",
64    ],
65    prefer_rlib: true,
66    features: [
67        "default",
68        "derive",
69        "error-context",
70        "help",
71        "std",
72        "usage",
73        "use_argh",
74    ],
75    init_rc: [
76        "prefetch.rc",
77    ],
78}
79
80// TODO: Add rust_test to enable unit testing - b/378554334
81