vmbase/pvmfw: Extract common build properties to defaults
All vmbase-based projects follow the same structure of build targets.
Extract common properties of their build rules into defaults.
vmbase_rust_defaults: rust_* targets, no-std, arm64 only
vmbase_cc_defaults: cc_* targets, no std, arm64 only
vmbase_elf_defaults: cc_binary, arm64 only, link vmbase_entry
Test: m pvmfw vmbase_example
Change-Id: I635ce939fd349b9ce02d20c26e48a95e8b84ca50
diff --git a/vmbase/example/Android.bp b/vmbase/example/Android.bp
index 4011807..e11bb2f 100644
--- a/vmbase/example/Android.bp
+++ b/vmbase/example/Android.bp
@@ -4,57 +4,33 @@
rust_ffi_static {
name: "libvmbase_example",
+ defaults: ["vmbase_ffi_defaults"],
crate_name: "vmbase_example",
srcs: ["src/main.rs"],
edition: "2021",
- no_stdlibs: true,
- stdlibs: [
- "libcompiler_builtins.rust_sysroot",
- "libcore.rust_sysroot",
- ],
rustlibs: [
"libaarch64_paging",
"libbuddy_system_allocator",
"liblog_rust_nostd",
"libvmbase",
],
- enabled: false,
- target: {
- android_arm64: {
- enabled: true,
- },
- },
apex_available: ["com.android.virt"],
}
cc_binary {
name: "vmbase_example_elf",
stem: "vmbase_example",
+ defaults: ["vmbase_elf_defaults"],
srcs: [
"idmap.S",
],
static_libs: [
- "libvmbase_entry",
"libvmbase_example",
],
- static_executable: true,
- nocrt: true,
- system_shared_libs: ["libc"],
- stl: "none",
linker_scripts: [
"image.ld",
":vmbase_sections",
],
- installable: false,
- enabled: false,
- target: {
- android_arm64: {
- enabled: true,
- },
- },
- sanitize: {
- hwaddress: false,
- },
apex_available: ["com.android.virt"],
}