| diff --git a/Android.bp b/Android.bp |
| index a3f7464..d398440 100644 |
| --- a/Android.bp |
| +++ b/Android.bp |
| @@ -1,74 +1,55 @@ |
| // This file is generated by cargo2android.py --run --device --dependencies --tests --patch=patches/Android.bp.patch. |
| |
| -rust_ffi_shared { |
| - name: "libquiche_shared", |
| - stem: "libquiche", |
| - host_supported: true, |
| - crate_name: "quiche", |
| - srcs: ["src/lib.rs"], |
| - edition: "2018", |
| - features: [ |
| - "boringssl-vendored", |
| - "default", |
| - ], |
| - rustlibs: [ |
| - "liblazy_static", |
| - "liblibc", |
| - "liblibm", |
| - "liblog_rust", |
| - "libring", |
| - ], |
| - static_libs: [ |
| - "libcrypto", |
| - "libssl", |
| +cc_library_headers { |
| + name: "libquiche_ffi_headers", |
| + export_include_dirs: ["include"], |
| + apex_available: [ |
| + "//apex_available:platform", |
| + "com.android.resolv", |
| ], |
| + min_sdk_version: "29", |
| } |
| |
| -rust_library { |
| - name: "libquiche", |
| +rust_defaults { |
| + name: "libquiche_defaults", |
| + stem: "libquiche", |
| host_supported: true, |
| crate_name: "quiche", |
| srcs: ["src/lib.rs"], |
| edition: "2018", |
| features: [ |
| - "boringssl-vendored", |
| + "boringssl", |
| "default", |
| ], |
| - rustlibs: [ |
| + // Link all crates statically to create a self-contained .so library. |
| + rlibs: [ |
| "liblazy_static", |
| "liblibc", |
| "liblibm", |
| "liblog_rust", |
| "libring", |
| ], |
| - static_libs: [ |
| + prefer_rlib: true, |
| + shared_libs: [ |
| "libcrypto", |
| "libssl", |
| ], |
| + // For DnsResolver (Mainline module introduced in Q). |
| + apex_available: [ |
| + "//apex_available:platform", |
| + "com.android.resolv", |
| + ], |
| + min_sdk_version: "29", |
| } |
| |
| -rust_ffi_static { |
| - name: "libquiche_static", |
| - stem: "libquiche", |
| - host_supported: true, |
| - crate_name: "quiche", |
| - srcs: ["src/lib.rs"], |
| - edition: "2018", |
| - features: [ |
| - "boringssl-vendored", |
| - "default", |
| - ], |
| - rustlibs: [ |
| - "liblazy_static", |
| - "liblibc", |
| - "liblibm", |
| - "liblog_rust", |
| - "libring", |
| - ], |
| - static_libs: [ |
| - "libcrypto", |
| - "libssl", |
| - ], |
| +rust_ffi { |
| + name: "libquiche_ffi", |
| + defaults: ["libquiche_defaults"], |
| +} |
| + |
| +rust_library { |
| + name: "libquiche", |
| + defaults: ["libquiche_defaults"], |
| } |
| |
| rust_defaults { |
| @@ -79,7 +60,7 @@ rust_defaults { |
| auto_gen_config: true, |
| edition: "2018", |
| features: [ |
| - "boringssl-vendored", |
| + "boringssl", |
| "default", |
| ], |
| rustlibs: [ |
| @@ -91,10 +72,16 @@ rust_defaults { |
| "libring", |
| "liburl", |
| ], |
| - static_libs: [ |
| + shared_libs: [ |
| "libcrypto", |
| "libssl", |
| ], |
| + data: [ |
| + "examples/cert.crt", |
| + "examples/cert.key", |
| + "examples/cert-big.crt", |
| + "examples/rootca.crt", |
| + ] |
| } |
| |
| rust_test_host { |