diff options
author | Andrew Walbran <qwandor@google.com> | 2023-05-12 18:41:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-05-12 18:41:51 +0000 |
commit | 3b2280d7209890c7a7b83640e505cddc4171a79d (patch) | |
tree | 4b942a7d871d9dc7110f4a91f49f77d4260f39b2 | |
parent | 8568f9fa7769cd5035e6c76ef47bbbcc4b5a969a (diff) | |
parent | d3ab1f922d445ebcf024cac2b1ba7416607bffca (diff) | |
download | zerocopy-3b2280d7209890c7a7b83640e505cddc4171a79d.tar.gz |
Use new no-std flag to cargo2android. am: 7842ed5a97 am: f5f7351ef3 am: d3ab1f922d
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/zerocopy/+/2584581
Change-Id: Ic1fe0055e5f6c84956226ee397ce29d191712473
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | Android.bp | 44 | ||||
-rw-r--r-- | cargo2android.json | 14 | ||||
-rw-r--r-- | cargo2android_nostd.bp | 17 |
3 files changed, 37 insertions, 38 deletions
@@ -38,41 +38,47 @@ rust_library { vendor_available: true, } -rust_test { - name: "zerocopy_test_src_lib", - host_supported: true, +rust_library_rlib { + name: "libzerocopy_nostd", crate_name: "zerocopy", cargo_env_compat: true, cargo_pkg_version: "0.6.1", srcs: ["src/lib.rs"], - test_suites: ["general-tests"], - auto_gen_config: true, - test_options: { - unit_test: true, - }, edition: "2018", rustlibs: [ - "libbyteorder", - "librand", + "libbyteorder_nostd", ], proc_macros: ["libzerocopy_derive"], + 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, } -rust_library_rlib { - name: "libzerocopy_nostd", +rust_test { + name: "zerocopy_test_src_lib", + host_supported: true, crate_name: "zerocopy", cargo_env_compat: true, cargo_pkg_version: "0.6.1", srcs: ["src/lib.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + test_options: { + unit_test: true, + }, edition: "2018", - no_stdlibs: true, rustlibs: [ - "libbyteorder_nostd", + "libbyteorder", + "librand", ], proc_macros: ["libzerocopy_derive"], - apex_available: [ - "//apex_available:platform", - "//apex_available:anyapex", - ], } - diff --git a/cargo2android.json b/cargo2android.json index c5c89d8..949ca69 100644 --- a/cargo2android.json +++ b/cargo2android.json @@ -1,6 +1,16 @@ { - "add-toplevel-block": "cargo2android_nostd.bp", "device": true, "run": true, - "tests": true + "variants": [ + { + "tests": true + }, + { + "dependency-suffix": "_nostd", + "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 2649817..0000000 --- a/cargo2android_nostd.bp +++ /dev/null @@ -1,17 +0,0 @@ -rust_library_rlib { - name: "libzerocopy_nostd", - crate_name: "zerocopy", - cargo_env_compat: true, - cargo_pkg_version: "0.6.1", - srcs: ["src/lib.rs"], - edition: "2018", - no_stdlibs: true, - rustlibs: [ - "libbyteorder_nostd", - ], - proc_macros: ["libzerocopy_derive"], - apex_available: [ - "//apex_available:platform", - "//apex_available:anyapex", - ], -} |