aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp10
-rw-r--r--patches/std.diff3
2 files changed, 8 insertions, 5 deletions
diff --git a/Android.bp b/Android.bp
index 07a3150..dd16711 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,7 @@
// This file is generated by cargo_embargo.
-// Do not modify this file as changes will be overridden on upgrade.
+// Do not modify this file after the first "rust_*" or "genrule" module
+// because the changes will be overridden on upgrade.
+// Content before the first "rust_*" or "genrule" module is preserved.
package {
default_applicable_licenses: ["external_rust_crates_cfg-if_license"],
@@ -43,7 +45,7 @@ rust_test {
crate_name: "cfg_if",
cargo_env_compat: true,
cargo_pkg_version: "1.0.0",
- srcs: ["src/lib.rs"],
+ crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
test_options: {
@@ -58,7 +60,7 @@ rust_test {
crate_name: "xcrate",
cargo_env_compat: true,
cargo_pkg_version: "1.0.0",
- srcs: ["tests/xcrate.rs"],
+ crate_root: "tests/xcrate.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
test_options: {
@@ -74,7 +76,7 @@ rust_library {
crate_name: "cfg_if",
cargo_env_compat: true,
cargo_pkg_version: "1.0.0",
- srcs: ["src/lib.rs"],
+ crate_root: "src/lib.rs",
edition: "2018",
apex_available: [
"//apex_available:platform",
diff --git a/patches/std.diff b/patches/std.diff
index 47fc53c..4334b2a 100644
--- a/patches/std.diff
+++ b/patches/std.diff
@@ -2,11 +2,12 @@ diff --git a/src/lib.rs b/src/lib.rs
index 52bbbe0..acea490 100644
--- a/src/lib.rs
+++ b/src/lib.rs
-@@ -28,6 +28,9 @@
+@@ -28,6 +28,10 @@
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]
+// ANDROID: Use std to allow building as a dylib.
++#[cfg(android_dylib)]
+extern crate std;
+
/// The main macro provided by this crate. See crate documentation for more