aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-05-11 16:32:49 +0000
committerAndrew Walbran <qwandor@google.com>2023-05-12 13:20:26 +0000
commit2112f9de2a43f92b007dd10000e715108b98d112 (patch)
treec21bf542dce657853e94cdde3756433d69bae0d9
parentf7d51f4fa182c7897cb2a53c49563271fdefb6ad (diff)
downloadserde-2112f9de2a43f92b007dd10000e715108b98d112.tar.gz
Use new cargo2android no-std flag rather than extra manual block.
Bug: 279614907 Test: m pvmfw Change-Id: Ia673fd0dce9259116afb9c1b884a7b570547a2dc
-rw-r--r--Android.bp17
-rw-r--r--cargo2android.json19
-rw-r--r--cargo2android_nostd.bp25
3 files changed, 25 insertions, 36 deletions
diff --git a/Android.bp b/Android.bp
index 676732d..7e5d067 100644
--- a/Android.bp
+++ b/Android.bp
@@ -70,13 +70,6 @@ rust_library_rlib {
cargo_pkg_version: "1.0.152",
srcs: ["src/lib.rs"],
edition: "2015",
- prefer_rlib: true,
- no_stdlibs: true,
- stdlibs: [
- "liballoc.rust_sysroot",
- "libcompiler_builtins.rust_sysroot",
- "libcore.rust_sysroot",
- ],
features: [
"alloc",
"derive",
@@ -87,6 +80,16 @@ rust_library_rlib {
"//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,
+ min_sdk_version: "29",
}
rust_test {
diff --git a/cargo2android.json b/cargo2android.json
index 89a0f3e..ed3dae4 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,13 +1,24 @@
{
- "add-toplevel-block": "cargo2android_nostd.bp",
"cfg-blocklist": [
"std_atomic64"
],
"dependencies": true,
"device": true,
- "features": "default,derive,rc",
+ "min_sdk_version": "29",
"run": true,
- "tests": true,
"vendor-available": true,
- "min_sdk_version": "29"
+ "variants": [
+ {
+ "features": "default,derive,rc",
+ "tests": true
+ },
+ {
+ "alloc": true,
+ "features": "alloc,derive",
+ "force-rlib": true,
+ "no-host": true,
+ "suffix": "_nostd",
+ "no-std": true
+ }
+ ]
}
diff --git a/cargo2android_nostd.bp b/cargo2android_nostd.bp
deleted file mode 100644
index d0e88d9..0000000
--- a/cargo2android_nostd.bp
+++ /dev/null
@@ -1,25 +0,0 @@
-rust_library_rlib {
- name: "libserde_nostd",
- crate_name: "serde",
- cargo_env_compat: true,
- cargo_pkg_version: "1.0.152",
- srcs: ["src/lib.rs"],
- edition: "2015",
- prefer_rlib: true,
- no_stdlibs: true,
- stdlibs: [
- "liballoc.rust_sysroot",
- "libcompiler_builtins.rust_sysroot",
- "libcore.rust_sysroot",
- ],
- features: [
- "alloc",
- "derive",
- "serde_derive",
- ],
- proc_macros: ["libserde_derive"],
- apex_available: [
- "//apex_available:platform",
- "//apex_available:anyapex",
- ],
-}