blob: 77c2eebaa1ca898e5ed061200b8c3eb3efb19d5a [file] [log] [blame]
// This file is generated by cargo_embargo.
// Do not modify this file after the first "rust_*" or "genrule" module
// because the changes will be overridden on upgrade.
// Content before the first "rust_*" or "genrule" module is preserved.
package {
default_applicable_licenses: ["external_crosvm_license"],
}
// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
name: "external_crosvm_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
"SPDX-license-identifier-MIT",
],
license_text: [
"LICENSE",
],
}
rust_binary {
name: "crosvm",
defaults: ["crosvm_inner_defaults"],
host_supported: true,
prefer_rlib: true,
crate_name: "crosvm",
cargo_env_compat: true,
cargo_pkg_version: "0.1.0",
srcs: ["src/main.rs"],
edition: "2021",
features: [
"android-sparse",
"android_display",
"android_display_stub",
"audio",
"balloon",
"config-file",
"gdb",
"gdbstub",
"gdbstub_arch",
"geniezone",
"gfxstream",
"gpu",
"gpu_display",
"gunyah",
"net",
"qcow",
"usb",
"virgl_renderer",
],
rustlibs: [
"libacpi_tables",
"libanyhow",
"libarch",
"libargh",
"libaudio_streams",
"libbase_rust",
"libbit_field",
"libbroker_ipc",
"libcfg_if",
"libcros_async",
"libcros_tracing",
"libcrosvm_cli",
"libdevices",
"libdisk",
"libgdbstub",
"libgdbstub_arch",
"libhypervisor",
"libjail",
"libkernel_cmdline",
"libkernel_loader",
"liblibc",
"liblibcras",
"liblog_rust",
"libmerge",
"libmetrics",
"libminijail_rust",
"libnet_util",
"libonce_cell",
"libp9",
"libresources",
"librutabaga_gfx",
"libserde",
"libserde_json",
"libserde_keyvalue",
"libsmallvec",
"libstatic_assertions",
"libswap",
"libsync_rust",
"libtempfile",
"libthiserror",
"libuuid",
"libvhost",
"libvm_control",
"libvm_memory",
"libzerocopy",
],
proc_macros: [
"libargh_helpers",
"libenumn",
"libremain",
],
visibility: ["//visibility:public"],
arch: {
x86_64: {
rustlibs: ["libx86_64_rust"],
},
arm64: {
rustlibs: ["libaarch64"],
},
riscv64: {
rustlibs: ["libriscv64"],
},
},
target: {
host: {
strip: {
keep_symbols_and_debug_frame: true,
},
},
android: {
shared_libs: [
// TODO(b/332677108): remove libc++ when display service is rewritten in rust.
"libc++",
"libbinder_ndk",
"libnativewindow",
"libprocessgroup",
],
},
host_linux: {
shared_libs: [
"libprocessgroup",
],
},
linux_bionic_arm64: {
relative_install_path: "aarch64-linux-bionic",
},
linux_glibc_x86_64: {
relative_install_path: "x86_64-linux-gnu",
},
linux_musl_x86_64: {
relative_install_path: "x86_64-linux-musl",
},
linux_musl_arm64: {
relative_install_path: "aarch64-linux-musl",
},
},
ld_flags: [
"-Wl,--rpath,\\$$ORIGIN",
"-Wl,--rpath,\\$$ORIGIN/../../lib64",
],
}
rust_test {
name: "crosvm_test_src_main",
defaults: ["crosvm_inner_defaults"],
host_supported: true,
crate_name: "crosvm",
cargo_env_compat: true,
cargo_pkg_version: "0.1.0",
srcs: ["src/main.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
test_options: {
unit_test: false,
},
edition: "2021",
features: [
"android-sparse",
"android_display",
"android_display_stub",
"audio",
"balloon",
"config-file",
"gdb",
"gdbstub",
"gdbstub_arch",
"geniezone",
"gfxstream",
"gpu",
"gpu_display",
"gunyah",
"net",
"qcow",
"usb",
"virgl_renderer",
],
rustlibs: [
"libacpi_tables",
"libanyhow",
"libarch",
"libargh",
"libaudio_streams",
"libbase_rust",
"libbit_field",
"libbroker_ipc",
"libcfg_if",
"libcros_async",
"libcros_tracing",
"libcrosvm_cli",
"libdevices",
"libdisk",
"libgdbstub",
"libgdbstub_arch",
"libhypervisor",
"libjail",
"libkernel_cmdline",
"libkernel_loader",
"liblibc",
"liblibcras",
"liblog_rust",
"libmerge",
"libmetrics",
"libminijail_rust",
"libnet_util",
"libonce_cell",
"libp9",
"librand",
"libresources",
"librutabaga_gfx",
"libserde",
"libserde_json",
"libserde_keyvalue",
"libsmallvec",
"libstatic_assertions",
"libswap",
"libsync_rust",
"libtempfile",
"libthiserror",
"libuuid",
"libvhost",
"libvm_control",
"libvm_memory",
"libzerocopy",
],
proc_macros: [
"libargh_helpers",
"libenumn",
"libremain",
],
arch: {
x86_64: {
rustlibs: ["libx86_64_rust"],
},
arm64: {
rustlibs: ["libaarch64"],
},
riscv64: {
rustlibs: ["libriscv64"],
},
},
target: {
host: {
strip: {
keep_symbols_and_debug_frame: true,
},
},
android: {
shared_libs: [
"libprocessgroup",
],
},
host_linux: {
shared_libs: [
"libprocessgroup",
],
},
},
ld_flags: [
"-Wl,--rpath,\\$$ORIGIN",
"-Wl,--rpath,\\$$ORIGIN/../../lib64",
],
}
rust_defaults {
name: "crosvm_defaults",
edition: "2018",
enabled: false,
target: {
linux_glibc_x86_64: {
enabled: true,
},
linux_musl_x86_64: {
enabled: true,
},
android64: {
compile_multilib: "64",
enabled: true,
},
linux_bionic_arm64: {
enabled: true,
},
linux_musl_arm64: {
enabled: true,
},
darwin: {
enabled: false,
},
},
apex_available: [
"com.android.virt",
],
defaults_visibility: [
"//external/crosvm:__subpackages__",
"//packages/modules/Virtualization/authfs",
// For QCOM's crosvm fork.
"//vendor:__subpackages__",
],
}
// "crosvm_defaults" is being used outside of external/crosvm, so we need a
// layer of indirection to add options that would break those users.
//
// TODO(b/238324526): move others off of "crosvm_defaults"
rust_defaults {
name: "crosvm_inner_defaults",
defaults: ["crosvm_defaults"],
defaults_visibility: ["//external/crosvm:__subpackages__"],
visibility: ["//external/crosvm:__subpackages__"],
}