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", |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 18 | "libvmbase", |
| 19 | ], |
| 20 | enabled: false, |
| 21 | target: { |
| 22 | android_arm64: { |
| 23 | enabled: true, |
| 24 | }, |
| 25 | }, |
| 26 | apex_available: ["com.android.virt"], |
| 27 | } |
| 28 | |
| 29 | cc_binary { |
| 30 | name: "vmbase_example_elf", |
| 31 | stem: "vmbase_example", |
| 32 | srcs: [ |
| 33 | "idmap.S", |
| 34 | ], |
| 35 | static_libs: [ |
| 36 | "libvmbase_entry", |
| 37 | "libvmbase_example", |
| 38 | ], |
| 39 | static_executable: true, |
| 40 | nocrt: true, |
| 41 | system_shared_libs: ["libc"], |
| 42 | stl: "none", |
| 43 | linker_scripts: ["image.ld"], |
| 44 | installable: false, |
| 45 | enabled: false, |
| 46 | target: { |
| 47 | android_arm64: { |
| 48 | enabled: true, |
| 49 | }, |
| 50 | }, |
Florian Mayer | 1da97eb | 2022-06-14 14:15:50 -0700 | [diff] [blame] | 51 | sanitize: { |
| 52 | hwaddress: false, |
| 53 | }, |
Andrew Walbran | eef9820 | 2022-04-27 16:23:06 +0000 | [diff] [blame] | 54 | apex_available: ["com.android.virt"], |
| 55 | } |
| 56 | |
| 57 | raw_binary { |
| 58 | name: "vmbase_example", |
| 59 | src: ":vmbase_example_elf", |
| 60 | stem: "vmbase_example.bin", |
| 61 | enabled: false, |
| 62 | target: { |
| 63 | android_arm64: { |
| 64 | enabled: true, |
| 65 | }, |
| 66 | }, |
| 67 | } |
Andrew Walbran | 94bbf2f | 2022-05-12 18:35:42 +0000 | [diff] [blame] | 68 | |
| 69 | rust_test { |
| 70 | name: "vmbase_example.integration_test", |
| 71 | crate_name: "vmbase_example_test", |
| 72 | srcs: ["tests/test.rs"], |
| 73 | prefer_rlib: true, |
| 74 | edition: "2021", |
| 75 | rustlibs: [ |
| 76 | "android.system.virtualizationservice-rust", |
| 77 | "libanyhow", |
| 78 | "libenv_logger", |
| 79 | "liblibc", |
| 80 | "liblog_rust", |
| 81 | "libvmclient", |
| 82 | ], |
| 83 | data: [ |
| 84 | ":vmbase_example", |
| 85 | ], |
| 86 | test_suites: ["general-tests"], |
| 87 | enabled: false, |
| 88 | target: { |
| 89 | android_arm64: { |
| 90 | enabled: true, |
| 91 | }, |
| 92 | }, |
| 93 | } |