Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
| 5 | rust_ffi_static { |
| 6 | name: "libvmbase_example", |
| 7 | crate_name: "vmbase_example", |
| 8 | srcs: ["src/main.rs"], |
| 9 | edition: "2021", |
| 10 | no_stdlibs: true, |
| 11 | stdlibs: [ |
| 12 | "libcompiler_builtins.rust_sysroot", |
| 13 | "libcore.rust_sysroot", |
| 14 | ], |
| 15 | rustlibs: [ |
Andrew Walbran | 1356454 | 2022-04-20 16:29:45 +0000 | [diff] [blame] | 16 | "libaarch64_paging", |
Andrew Walbran | f7b6dc8 | 2022-04-20 16:24:30 +0000 | [diff] [blame] | 17 | "libbuddy_system_allocator", |
David Brazdil | b41aa8f | 2022-07-05 12:41:00 +0100 | [diff] [blame] | 18 | "liblog_rust_nostd", |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 19 | "libvmbase", |
| 20 | ], |
| 21 | enabled: false, |
| 22 | target: { |
| 23 | android_arm64: { |
| 24 | enabled: true, |
| 25 | }, |
| 26 | }, |
| 27 | apex_available: ["com.android.virt"], |
| 28 | } |
| 29 | |
| 30 | cc_binary { |
| 31 | name: "vmbase_example_elf", |
| 32 | stem: "vmbase_example", |
| 33 | srcs: [ |
| 34 | "idmap.S", |
| 35 | ], |
| 36 | static_libs: [ |
| 37 | "libvmbase_entry", |
| 38 | "libvmbase_example", |
| 39 | ], |
| 40 | static_executable: true, |
| 41 | nocrt: true, |
| 42 | system_shared_libs: ["libc"], |
| 43 | stl: "none", |
Andrew Walbran | a5b7af5 | 2022-07-06 15:06:20 +0000 | [diff] [blame] | 44 | linker_scripts: [ |
| 45 | "image.ld", |
| 46 | ":vmbase_sections", |
| 47 | ], |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 48 | installable: false, |
| 49 | enabled: false, |
| 50 | target: { |
| 51 | android_arm64: { |
| 52 | enabled: true, |
| 53 | }, |
| 54 | }, |
Florian Mayer | 1da97eb | 2022-06-14 14:15:50 -0700 | [diff] [blame] | 55 | sanitize: { |
| 56 | hwaddress: false, |
| 57 | }, |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 58 | apex_available: ["com.android.virt"], |
| 59 | } |
| 60 | |
| 61 | raw_binary { |
| 62 | name: "vmbase_example", |
| 63 | src: ":vmbase_example_elf", |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 64 | enabled: false, |
| 65 | target: { |
| 66 | android_arm64: { |
| 67 | enabled: true, |
| 68 | }, |
| 69 | }, |
| 70 | } |
Andrew Walbran | 94bbf2f | 2022-05-12 18:35:42 +0000 | [diff] [blame] | 71 | |
| 72 | rust_test { |
| 73 | name: "vmbase_example.integration_test", |
| 74 | crate_name: "vmbase_example_test", |
| 75 | srcs: ["tests/test.rs"], |
| 76 | prefer_rlib: true, |
| 77 | edition: "2021", |
| 78 | rustlibs: [ |
| 79 | "android.system.virtualizationservice-rust", |
| 80 | "libanyhow", |
| 81 | "libenv_logger", |
| 82 | "liblibc", |
| 83 | "liblog_rust", |
| 84 | "libvmclient", |
| 85 | ], |
| 86 | data: [ |
| 87 | ":vmbase_example", |
| 88 | ], |
| 89 | test_suites: ["general-tests"], |
| 90 | enabled: false, |
| 91 | target: { |
| 92 | android_arm64: { |
| 93 | enabled: true, |
| 94 | }, |
| 95 | }, |
| 96 | } |