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