aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp2
-rw-r--r--cargo2android.json1
-rw-r--r--patches/dylib-std.patch14
-rw-r--r--src/lib.rs3
4 files changed, 18 insertions, 2 deletions
diff --git a/Android.bp b/Android.bp
index 05a9aa3..1d545f3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -20,7 +20,7 @@ license {
],
}
-rust_library_rlib {
+rust_library {
name: "libstatic_assertions",
host_supported: true,
crate_name: "static_assertions",
diff --git a/cargo2android.json b/cargo2android.json
index f41bf78..ac5389c 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,6 +1,5 @@
{
"device": true,
- "force-rlib": true,
"no_pkg_vers": true,
"min-sdk-version": "29",
"vendor-available": true,
diff --git a/patches/dylib-std.patch b/patches/dylib-std.patch
new file mode 100644
index 0000000..7864526
--- /dev/null
+++ b/patches/dylib-std.patch
@@ -0,0 +1,14 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index aa7e227..df47529 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -101,6 +101,9 @@
+ )]
+ #![no_std]
+
++#[cfg(android_dylib)]
++extern crate std;
++
+ #[cfg(feature = "proc_static_assertions")]
+ extern crate proc_static_assertions;
+ #[cfg(feature = "proc_static_assertions")]
diff --git a/src/lib.rs b/src/lib.rs
index aa7e227..df47529 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -101,6 +101,9 @@
)]
#![no_std]
+#[cfg(android_dylib)]
+extern crate std;
+
#[cfg(feature = "proc_static_assertions")]
extern crate proc_static_assertions;
#[cfg(feature = "proc_static_assertions")]