SConscript 775 B

12345678910111213141516171819202122232425
  1. # Test cxx descriptor functionality
  2. Import('env')
  3. base_env = env.Clone()
  4. base_env.Replace(NANOPBFLAGS = '--cpp-descriptor')
  5. base_env.NanopbProto('message')
  6. for std in ["c++03", "c++11", "c++14", "c++17", "c++20"]:
  7. e = base_env.Clone()
  8. e.Append(CXXFLAGS = '-std={}'.format(std))
  9. # Make sure compiler supports this version of C++ before we actually run the
  10. # test.
  11. conf = Configure(e)
  12. compiler_valid = conf.CheckCXX()
  13. e = conf.Finish()
  14. if not compiler_valid:
  15. print("Skipping {} test - compiler doesn't support it".format(std))
  16. continue
  17. o1 = e.Object('message_descriptor_{}'.format(std), 'message_descriptor.cc')
  18. o2 = e.Object('message.pb_{}'.format(std), 'message.pb.c')
  19. p = e.Program([o1, o2])
  20. e.RunTest(p)