SConscript 710 B

12345678910111213141516171819
  1. # Test anonymous_oneof generator option
  2. Import('env')
  3. # Anonymous oneofs are supported by clang and gcc
  4. if 'clang' in env['CC'] or 'gcc' in env['CC']:
  5. env2 = env.Clone()
  6. if '-pedantic' in env2['CFLAGS']:
  7. env2['CFLAGS'].remove('-pedantic')
  8. env2.NanopbProto('oneof')
  9. dec = env2.Program(['decode_oneof.c',
  10. 'oneof.pb.c',
  11. '$COMMON/pb_decode.o',
  12. '$COMMON/pb_common.o'])
  13. env2.RunTest("message1.txt", [dec, '$BUILD/oneof/message1.pb'], ARGS = ['1'])
  14. env2.RunTest("message2.txt", [dec, '$BUILD/oneof/message2.pb'], ARGS = ['2'])
  15. env2.RunTest("message3.txt", [dec, '$BUILD/oneof/message3.pb'], ARGS = ['3'])