diff options
author | David Drysdale <drysdale@google.com> | 2023-10-04 11:41:14 +0100 |
---|---|---|
committer | David Drysdale <drysdale@google.com> | 2023-10-04 11:41:14 +0100 |
commit | 7b1a8296425d7dce6a31e46cc0ca45b985d67b56 (patch) | |
tree | 1a2b6ffa0faeb1aae62b1d041962704e69280b6d | |
parent | 1ddb3bec93394eeb62ee4f4187e8579b489c3d07 (diff) | |
download | hex-7b1a8296425d7dce6a31e46cc0ca45b985d67b56.tar.gz |
Add baremetal _nostd variant
Bug: 303192701
Test: build both variants
Change-Id: Ia9a78aed110f58f67b03a9325748081391d0189c
-rw-r--r-- | Android.bp | 23 | ||||
-rw-r--r-- | cargo2android.json | 16 |
2 files changed, 38 insertions, 1 deletions
@@ -58,3 +58,26 @@ rust_library { product_available: true, vendor_available: true, } + +rust_library_rlib { + name: "libhex_nostd", + crate_name: "hex", + cargo_env_compat: true, + cargo_pkg_version: "0.4.3", + srcs: ["src/lib.rs"], + edition: "2018", + features: ["alloc"], + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], + prefer_rlib: true, + no_stdlibs: true, + stdlibs: [ + "liballoc.rust_sysroot", + "libcompiler_builtins.rust_sysroot", + "libcore.rust_sysroot", + ], + product_available: true, + vendor_available: true, +} diff --git a/cargo2android.json b/cargo2android.json index bf949e6..d3874c5 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -1,5 +1,19 @@ { "device": true, "run": true, - "vendor-available": true + "vendor-available": true, + "variants": [ + { + }, + { + "device": true, + "alloc": true, + "no-host": true, + "dependency_suffix": "_nostd", + "force-rlib": true, + "suffix": "_nostd", + "no-std": true, + "features" : "alloc" + } + ] } |