Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 1 | diff --git a/Android.bp b/Android.bp |
| 2 | index 40ed7bc..12928a0 100644 |
| 3 | --- a/Android.bp |
| 4 | +++ b/Android.bp |
| 5 | @@ -4,7 +4,10 @@ rust_library { |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 6 | name: "libgrpcio_sys", |
| 7 | host_supported: true, |
| 8 | crate_name: "grpcio_sys", |
| 9 | - srcs: ["src/lib.rs"], |
| 10 | + srcs: [ |
| 11 | + "src/lib.rs", |
| 12 | + ":libgrpc_bindgen", |
| 13 | + ], |
| 14 | edition: "2018", |
| 15 | features: [ |
| 16 | "default", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 17 | @@ -14,48 +17,56 @@ rust_library { |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 18 | "liblibc", |
| 19 | "liblibz_sys", |
| 20 | ], |
| 21 | - static_libs: [ |
| 22 | - "libabsl_bad_optional_access", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 23 | - "libabsl_bad_variant_access", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 24 | - "libabsl_base", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 25 | - "libabsl_city", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 26 | - "libabsl_civil_time", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 27 | - "libabsl_cord", |
| 28 | - "libabsl_debugging_internal", |
| 29 | - "libabsl_demangle_internal", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 30 | - "libabsl_dynamic_annotations", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 31 | - "libabsl_exponential_biased", |
| 32 | - "libabsl_graphcycles_internal", |
| 33 | - "libabsl_hash", |
| 34 | - "libabsl_hashtablez_sampler", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 35 | - "libabsl_int128", |
| 36 | - "libabsl_log_severity", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 37 | - "libabsl_malloc_internal", |
| 38 | - "libabsl_raw_hash_set", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 39 | - "libabsl_raw_logging_internal", |
| 40 | - "libabsl_spinlock_wait", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 41 | - "libabsl_stacktrace", |
| 42 | - "libabsl_status", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 43 | - "libabsl_str_format_internal", |
| 44 | - "libabsl_strings", |
| 45 | - "libabsl_strings_internal", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 46 | - "libabsl_symbolize", |
| 47 | - "libabsl_synchronization", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 48 | - "libabsl_throw_delegate", |
| 49 | - "libabsl_time", |
| 50 | - "libabsl_time_zone", |
| 51 | - "libaddress_sorting", |
| 52 | - "libcares", |
| 53 | - "libcrypto", |
| 54 | - "libgpr", |
| 55 | - "libgrpc", |
| 56 | - "libgrpc_wrap", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 57 | - "libre2", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 58 | - "libssl", |
| 59 | - "libupb", |
| 60 | - "libz", |
| 61 | + shared_libs: [ |
| 62 | + "libgrpc++", |
| 63 | + "libgrpc_wrap" |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 64 | ], |
| 65 | - shared_libs: ["libstdc++"], |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 66 | +} |
| 67 | + |
| 68 | +cc_defaults { |
| 69 | + name: "libgrpcio_sys_defaults", |
| 70 | + cflags: [ |
| 71 | + "-DGRPC_SYS_SECURE", |
Jeff Vander Stoep | 08902cf | 2020-11-19 19:03:52 +0100 | [diff] [blame] | 72 | + ], |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 73 | + cpp_std: "c++11", |
| 74 | + shared_libs: ["libgrpc++"], |
| 75 | +} |
| 76 | + |
| 77 | +cc_library { |
| 78 | + name: "libgrpc_wrap", |
| 79 | + defaults: ["libgrpcio_sys_defaults"], |
| 80 | + host_supported: true, |
| 81 | + srcs: ["grpc_wrap.cc"], |
| 82 | +} |
| 83 | + |
| 84 | +rust_bindgen { |
| 85 | + name: "libgrpc_bindgen", |
| 86 | + defaults: ["libgrpcio_sys_defaults"], |
| 87 | + host_supported: true, |
| 88 | + wrapper_src: "android/bindgen_wrapper.hpp", |
| 89 | + source_stem: "grpc-bindings", |
| 90 | + crate_name: "grpc_bindgen", |
| 91 | + bindgen_flags: [ |
| 92 | + "--size_t-is-usize", |
| 93 | + "--constified-enum-module grpc_status_code", |
| 94 | + "--default-enum-style rust", |
| 95 | + "--whitelist-function=\\bgrpc_.*", |
| 96 | + "--whitelist-function=\\bgpr_.*", |
Chih-Hung Hsieh | 98a8525 | 2020-10-30 19:17:03 -0700 | [diff] [blame] | 97 | + "--whitelist-function=\\bgrpcwrap_.*", |
| 98 | + "--whitelist-var=\\bGRPC_.*", |
| 99 | + "--whitelist-type=\\bgrpc_.*", |
| 100 | + "--whitelist-type=\\bgpr_.*", |
| 101 | + "--whitelist-type=\\bgrpcwrap_.*", |
| 102 | + "--whitelist-type=\\bcensus_context.*", |
| 103 | + "--whitelist-type=\\bverify_peer_options.*", |
| 104 | + "--blacklist-type=(__)?pthread.*", |
| 105 | + "--blacklist-function=\\bgpr_mu_.*", |
| 106 | + "--blacklist-function=\\bgpr_cv_.*", |
| 107 | + "--blacklist-function=\\bgpr_once_.*", |
| 108 | + "--blacklist-type=gpr_mu", |
| 109 | + "--blacklist-type=gpr_cv", |
| 110 | + "--blacklist-type=gpr_once", |
| 111 | + ] |
| 112 | } |
| 113 | |
| 114 | // dependent_library ["feature_list"] |