aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-05-12 13:52:38 +0000
committerAndrew Walbran <qwandor@google.com>2023-05-12 13:52:38 +0000
commit81e4c4d68c576507951cfa5001c14faf5ac5a3dd (patch)
tree8f8e4cb140867be006f0d4c05398ffcbc805f089
parent3717e50a4895f69a726d1489254d9c4ad612c28b (diff)
downloadbyteorder-81e4c4d68c576507951cfa5001c14faf5ac5a3dd.tar.gz
Use new no-std flag to cargo2android.
Bug: 279614907 Test: Ran cargo2android and compared Android.bp Change-Id: Icc871e4d70c26e1cdfe74c6b0616d416671d2397
-rw-r--r--Android.bp5
-rw-r--r--cargo2android.json13
-rw-r--r--cargo2android_nostd.bp15
3 files changed, 16 insertions, 17 deletions
diff --git a/Android.bp b/Android.bp
index f327378..4af177a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -65,11 +65,16 @@ rust_library_rlib {
cargo_pkg_version: "1.4.3",
srcs: ["src/lib.rs"],
edition: "2018",
+ apex_available: [
+ "//apex_available:platform",
+ "//apex_available:anyapex",
+ ],
prefer_rlib: true,
no_stdlibs: true,
stdlibs: [
"libcompiler_builtins.rust_sysroot",
"libcore.rust_sysroot",
],
+ product_available: true,
vendor_available: true,
}
diff --git a/cargo2android.json b/cargo2android.json
index e63efdb..1014789 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,7 +1,16 @@
{
- "add-toplevel-block": "cargo2android_nostd.bp",
"dependencies": true,
"device": true,
"run": true,
- "vendor-available": true
+ "variants": [
+ {
+ },
+ {
+ "features": "",
+ "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 1db2e43..0000000
--- a/cargo2android_nostd.bp
+++ /dev/null
@@ -1,15 +0,0 @@
-rust_library_rlib {
- name: "libbyteorder_nostd",
- crate_name: "byteorder",
- cargo_env_compat: true,
- cargo_pkg_version: "1.4.3",
- srcs: ["src/lib.rs"],
- edition: "2018",
- prefer_rlib: true,
- no_stdlibs: true,
- stdlibs: [
- "libcompiler_builtins.rust_sysroot",
- "libcore.rust_sysroot",
- ],
- vendor_available: true,
-} \ No newline at end of file