From fe19fca0e521e3765e4ecf6a87b0a3d622a52b92 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Tue, 13 Feb 2018 17:46:09 -0500 Subject: Serialize and deserialize null (#783) * Build (grpc's) nanopb with -DPB_FIELD_16BIT We require (at least) 16 bit fields. (By default, nanopb uses 8 bit fields, ie allowing up to 256 field tags.) Also note that this patch adds this to grpc's nanopb, rather than to our nanopb. We'll need to eventually either: a) we instruct grpc to use our nanopb b) we rely on grpc's nanopb instead of using our own. (^ marked as a TODO for now.) * Add some dependant protos Imported from protobuf. Nanopb requires these to be present (though anything using libprotobuf does not, as these are already built into that.) * Add generated nanopb protos based off of newly added proto definitions * Build the nanopb protos * Serialize and deserialize null --- cmake/external/grpc.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/external/grpc.cmake b/cmake/external/grpc.cmake index 0af6b31..d545087 100644 --- a/cmake/external/grpc.cmake +++ b/cmake/external/grpc.cmake @@ -68,7 +68,15 @@ else() PREFIX ${PROJECT_BINARY_DIR}/external/grpc - CMAKE_ARGS ${CMAKE_ARGS} + # TODO(rsgowman): We're currently building nanopb twice; once via grpc, and + # once via nanopb. The version from grpc is the one that actually ends up + # being used. We need to fix this such that either: + # a) we instruct grpc to use our nanopb + # b) we rely on grpc's nanopb instead of using our own. + # For now, we'll pass in the necessary nanopb cflags into grpc. (We require + # 16 bit fields. Without explicitly requesting this, nanopb uses 8 bit + # fields.) + CMAKE_ARGS ${CMAKE_ARGS};-DCMAKE_C_FLAGS=-DPB_FIELD_16BIT;DCMAKE_CXX_FLAGS=-DPB_FIELD_16BIT BUILD_COMMAND ${CMAKE_COMMAND} --build . --target grpc -- cgit v1.2.3