blob: b5322a8a2e4b721feb6e21645428b01f853f8d14 [file] [log] [blame]
Alice Wangfb46ee12022-09-30 13:08:52 +00001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
Alan Stokesbcc2ec22022-10-31 17:02:50 +00005// The Rust implementation of the C API.
6rust_ffi_static {
7 name: "libvm_payload_impl",
Alice Wangfb46ee12022-09-30 13:08:52 +00008 crate_name: "vm_payload",
Nikita Ioffeda1b2732023-09-04 13:46:56 +01009 defaults: ["avf_build_flags_rust"],
Alan Stokesbcc2ec22022-10-31 17:02:50 +000010 visibility: ["//visibility:private"],
Alice Wangfb46ee12022-09-30 13:08:52 +000011 srcs: ["src/*.rs"],
12 include_dirs: ["include"],
13 prefer_rlib: true,
14 rustlibs: [
Alice Wang59a9e562022-10-04 15:24:10 +000015 "android.system.virtualization.payload-rust",
Alice Wangfb46ee12022-09-30 13:08:52 +000016 "libandroid_logger",
17 "libanyhow",
18 "libbinder_rs",
Alice Wang6bbb6da2022-10-26 12:44:06 +000019 "liblazy_static",
David Brazdil451cc962022-10-14 14:08:12 +010020 "liblibc",
Alice Wangfb46ee12022-09-30 13:08:52 +000021 "liblog_rust",
Alice Wang2be64f32022-10-13 14:37:35 +000022 "librpcbinder_rs",
David Brazdil73988ea2022-11-11 15:10:32 +000023 "libvsock",
Alice Wangfb46ee12022-09-30 13:08:52 +000024 ],
Alice Wangfb46ee12022-09-30 13:08:52 +000025}
Alice Wangbd569a02022-10-06 15:23:24 +000026
Alan Stokesbcc2ec22022-10-31 17:02:50 +000027// Rust wrappers round the C API for Rust clients.
28// (Yes, this involves going Rust -> C -> Rust.)
Alice Wangbd569a02022-10-06 15:23:24 +000029rust_bindgen {
30 name: "libvm_payload_bindgen",
Alan Stokesd4ea5a82022-11-10 12:17:42 +000031 wrapper_src: "include-restricted/vm_payload_restricted.h",
Alice Wangbd569a02022-10-06 15:23:24 +000032 crate_name: "vm_payload_bindgen",
Nikita Ioffeda1b2732023-09-04 13:46:56 +010033 defaults: ["avf_build_flags_rust"],
Alice Wangbd569a02022-10-06 15:23:24 +000034 source_stem: "bindings",
35 apex_available: ["com.android.compos"],
Alice Wangc2fec932023-02-23 16:24:02 +000036 visibility: [
37 "//packages/modules/Virtualization/compos",
Alice Wangac080d32023-11-02 13:12:25 +000038 "//packages/modules/Virtualization/service_vm/test_apk",
Alice Wangc2fec932023-02-23 16:24:02 +000039 ],
Alice Wangbd569a02022-10-06 15:23:24 +000040 shared_libs: [
Alan Stokesbcc2ec22022-10-31 17:02:50 +000041 "libvm_payload#current",
Alice Wangbd569a02022-10-06 15:23:24 +000042 ],
43}
Alan Stokes52d3c722022-10-04 17:27:13 +010044
Alan Stokesbcc2ec22022-10-31 17:02:50 +000045// Shared library for clients to link against.
46cc_library_shared {
47 name: "libvm_payload",
48 shared_libs: [
49 "libbinder_ndk",
50 "libbinder_rpc_unstable",
51 "liblog",
52 ],
53 whole_static_libs: ["libvm_payload_impl"],
54 export_static_lib_headers: ["libvm_payload_impl"],
55 installable: false,
56 version_script: "libvm_payload.map.txt",
57 stubs: {
58 symbol_file: "libvm_payload.map.txt",
59 // Implementation is available inside a Microdroid VM.
60 implementation_installable: false,
61 },
62}
63
64// Just the headers. Mostly useful for clients that only want the
65// declaration of AVmPayload_main().
Alan Stokes52d3c722022-10-04 17:27:13 +010066cc_library_headers {
67 name: "vm_payload_headers",
Alan Stokesd4ea5a82022-11-10 12:17:42 +000068 apex_available: ["com.android.compos"],
Alan Stokes52d3c722022-10-04 17:27:13 +010069 export_include_dirs: ["include"],
70}
Alan Stokesd4ea5a82022-11-10 12:17:42 +000071
Alan Stokesbcc2ec22022-10-31 17:02:50 +000072// Restricted headers for use by internal clients & associated tests.
Alan Stokesd4ea5a82022-11-10 12:17:42 +000073cc_library_headers {
74 name: "vm_payload_restricted_headers",
75 header_libs: ["vm_payload_headers"],
76 export_header_lib_headers: ["vm_payload_headers"],
77 export_include_dirs: ["include-restricted"],
78 apex_available: ["com.android.compos"],
79 visibility: ["//packages/modules/Virtualization:__subpackages__"],
80}