SConscript 593 B

123456789101112131415161718192021
  1. # Example / test for handling 'map' type using the backwards compatibility
  2. # in protobuf specification:
  3. # https://developers.google.com/protocol-buffers/docs/proto3#maps
  4. Import('env')
  5. env.NanopbProto(['map', 'map.options'])
  6. enc = env.Program(['encode_map.c',
  7. 'map.pb.c',
  8. '$COMMON/pb_encode.o',
  9. '$COMMON/pb_common.o'])
  10. dec = env.Program(['decode_map.c',
  11. 'map.pb.c',
  12. '$COMMON/pb_decode.o',
  13. '$COMMON/pb_common.o'])
  14. env.RunTest("message.pb", enc)
  15. env.RunTest("message.txt", [dec, 'message.pb'])