• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo2android.py --config cargo2android.json.
2// Do not modify this file as changes will be overridden on upgrade.
3
4package {
5    // See: http://go/android-license-faq
6    // A large-scale-change added 'default_applicable_licenses' to import
7    // all of the 'license_kinds' from "external_crosvm_license"
8    // to get the below license kinds:
9    //   SPDX-license-identifier-BSD
10    default_applicable_licenses: ["external_crosvm_license"],
11}
12
13rust_test {
14    name: "base_test_src_lib",
15    defaults: ["crosvm_defaults"],
16    crate_name: "base",
17    cargo_env_compat: true,
18    cargo_pkg_version: "0.1.0",
19    srcs: ["src/lib.rs"],
20    test_suites: ["general-tests"],
21    auto_gen_config: true,
22    test_options: {
23        unit_test: true,
24    },
25    edition: "2021",
26    rustlibs: [
27        "libaudio_streams",
28        "libcfg_if",
29        "libchrono",
30        "libdata_model",
31        "liblibc",
32        "librand",
33        "libregex",
34        "libserde",
35        "libserde_json",
36        "libsmallvec",
37        "libsync_rust",
38        "libtempfile",
39        "libthiserror",
40    ],
41    proc_macros: [
42        "libbase_poll_token_derive",
43        "libremain",
44    ],
45    target: {
46        android: {
47            rustlibs: ["libandroid_log_sys"],
48        },
49        linux_bionic_arm64: {
50            // For ARM architecture, we use aarch64-linux-android for BOTH
51            // device and host targets. As a result, host targets are also
52            // built with target_os = "android". Therefore, sys_util/src/android
53            // is used and thus this android module is required.
54            // This seems incorrect, but is inevitable because rustc doesn't
55            // yet support a Linux-based target using Bionic as libc. We can't
56            // use aarch64-unknown-linux-gnu because it's using glibc which
57            // we don't support for cross-host builds.
58            rustlibs: [
59                "libandroid_log_sys",
60            ],
61        },
62    },
63    shared_libs: ["libcap"], // specified in src/unix/capabilities.rs
64}
65
66rust_library {
67    name: "libbase_rust",
68    defaults: ["crosvm_defaults"],
69    stem: "libbase",
70    host_supported: true,
71    crate_name: "base",
72    cargo_env_compat: true,
73    cargo_pkg_version: "0.1.0",
74    srcs: ["src/lib.rs"],
75    edition: "2021",
76    rustlibs: [
77        "libaudio_streams",
78        "libcfg_if",
79        "libchrono",
80        "libdata_model",
81        "liblibc",
82        "librand",
83        "libregex",
84        "libserde",
85        "libserde_json",
86        "libsmallvec",
87        "libsync_rust",
88        "libtempfile",
89        "libthiserror",
90    ],
91    proc_macros: [
92        "libbase_poll_token_derive",
93        "libremain",
94    ],
95    target: {
96        android: {
97            rustlibs: ["libandroid_log_sys"],
98        },
99        linux_bionic_arm64: {
100            // For ARM architecture, we use aarch64-linux-android for BOTH
101            // device and host targets. As a result, host targets are also
102            // built with target_os = "android". Therefore, sys_util/src/android
103            // is used and thus this android module is required.
104            // This seems incorrect, but is inevitable because rustc doesn't
105            // yet support a Linux-based target using Bionic as libc. We can't
106            // use aarch64-unknown-linux-gnu because it's using glibc which
107            // we don't support for cross-host builds.
108            rustlibs: [
109                "libandroid_log_sys",
110            ],
111        },
112    },
113    shared_libs: ["libcap"], // specified in src/unix/capabilities.rs
114}
115