From e7908d7b624591c4cae55e66f5e603d061addd8f Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 26 Oct 2018 23:28:02 -0700 Subject: [PATCH] Convert statsd_test and statsd_benchmark to proto lite libplatformprotos for the device is compiled using proto lite, and statsd_test and statsd_benchmark have protos that reference the libplatformprotos. With protobuf 3.5.2 compiling a full proto against a lite proto doesn't work. Convert them to lite. Requires adding the protobuf internal protos to the sources, libprotobuf-cpp-lite does not contain the compiled version of field_options.proto. Bug: 117607748 Test: m checkbuild Change-Id: I6a618c4118972c0e5ffb07a361ac6612b9069c5d --- cmds/statsd/Android.bp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp index 5c3d17e305859..ef631611647ba 100644 --- a/cmds/statsd/Android.bp +++ b/cmds/statsd/Android.bp @@ -196,6 +196,10 @@ cc_test { ], srcs: [ + // atom_field_options.proto needs field_options.proto, but that is + // not included in libprotobuf-cpp-lite, so compile it here. + ":libprotobuf-internal-protos", + "src/atom_field_options.proto", "src/atoms.proto", "src/stats_log.proto", @@ -245,11 +249,11 @@ cc_test { static_libs: ["libgmock"], proto: { - type: "full", + type: "lite", include_dirs: ["external/protobuf/src"], }, - shared_libs: ["libprotobuf-cpp-full"], + shared_libs: ["libprotobuf-cpp-lite"], } @@ -262,6 +266,10 @@ cc_benchmark { defaults: ["statsd_defaults"], srcs: [ + // atom_field_options.proto needs field_options.proto, but that is + // not included in libprotobuf-cpp-lite, so compile it here. + ":libprotobuf-internal-protos", + "src/atom_field_options.proto", "src/atoms.proto", "src/stats_log.proto", @@ -276,7 +284,7 @@ cc_benchmark { ], proto: { - type: "full", + type: "lite", include_dirs: ["external/protobuf/src"], }, @@ -294,7 +302,7 @@ cc_benchmark { shared_libs: [ "libgtest_prod", "libstatslog", - "libprotobuf-cpp-full", + "libprotobuf-cpp-lite", ], }