// This file is generated by cargo2android.py --run --device --tests --dependencies --global_defaults=crosvm_defaults --add_workspace --no-subdir. // Do not modify this file as changes will be overridden on upgrade. package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "external_crosvm_license" // to get the below license kinds: // SPDX-license-identifier-BSD default_applicable_licenses: ["external_crosvm_license"], } rust_library { name: "libsys_util", defaults: ["crosvm_defaults"], host_supported: true, crate_name: "sys_util", srcs: ["src/lib.rs"], edition: "2018", rustlibs: [ "libdata_model", "liblibc", "libserde", "libserde_json", "libsync_rust", "libtempfile", ], proc_macros: ["libpoll_token_derive"], shared_libs: ["libcap"], // specified in src/capabilities.rs target: { android: { rustlibs: [ "libandroid_log_sys", ], }, linux_bionic_arm64: { // For ARM architecture, we use aarch64-linux-android for BOTH // device and host targets. As a result, host targets are also // built with target_os = "android". Therefore, sys_util/src/android // is used and thus this android module is required. // This seems incorrect, but is inevitable because rustc doesn't // yet support a Linux-based target using Bionic as libc. We can't // use aarch64-unknown-linux-gnu because it's using glibc which // we don't support for cross-host builds. rustlibs: [ "libandroid_log_sys", ], }, }, } rust_defaults { name: "sys_util_defaults", defaults: ["crosvm_defaults"], crate_name: "sys_util", srcs: ["src/lib.rs"], test_suites: ["general-tests"], auto_gen_config: true, edition: "2018", rustlibs: [ "libdata_model", "liblibc", "libserde", "libserde_json", "libsync_rust", "libtempfile", ], proc_macros: ["libpoll_token_derive"], shared_libs: ["libcap"], // specified in src/capabilities.rs } // TODO: This doesn't link because of missing getrandom in Bionic (host only, it's // available in the guest). Fix it upstream. // rust_test_host { // name: "sys_util_host_test_src_lib", // defaults: ["sys_util_defaults"], // test_options: { // unit_test: true, // }, // } // TODO: This doesn't build due to missing shm_open &c. in Bionic. Fix it upstream. //rust_test { // name: "sys_util_device_test_src_lib", // defaults: ["sys_util_defaults"], // rustlibs: [ // "libandroid_log_sys", // ], //} // dependent_library ["feature_list"] // ../assertions/src/lib.rs // ../data_model/src/lib.rs // ../sync/src/lib.rs // ../tempfile/src/lib.rs // itoa-0.4.7 // libc-0.2.93 "default,std" // proc-macro2-1.0.26 "default,proc-macro" // quote-1.0.9 "default,proc-macro" // ryu-1.0.5 // serde-1.0.125 "default,derive,serde_derive,std" // serde_derive-1.0.125 "default" // serde_json-1.0.64 "default,std" // syn-1.0.70 "clone-impls,default,derive,parsing,printing,proc-macro,quote" // unicode-xid-0.2.1 "default"