wscript 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #! /usr/bin/env python
  2. top = '.'
  3. out = 'build'
  4. def options(opt):
  5. opt.load('compiler_cxx python java')
  6. def configure(conf):
  7. conf.load('compiler_cxx python java protoc')
  8. conf.check_python_version(minver=(2, 5, 0))
  9. # Here you have to point to your protobuf-java JAR
  10. conf.env.CLASSPATH_PROTOBUF = ['/tmp/cp/protobuf-java-2.5.0.jar']
  11. def build(bld):
  12. bld(
  13. features = 'cxx cxxshlib',
  14. source = ['inc/message_inc.proto','inc/message.proto'],
  15. name = 'somelib',
  16. target = 'somelib',
  17. includes = ['inc'],
  18. export_includes = ['inc'])
  19. bld(
  20. features = 'cxx cxxshlib',
  21. source = ['incdeep/a/b/test.proto'],
  22. target = 'somedeeplib',
  23. includes = ['incdeep'])
  24. bld(
  25. features = 'cxx cxxshlib',
  26. source = ['incseparate/depinotherdir.proto'],
  27. target = 'crossdirlib',
  28. includes = ['incseparate'],
  29. use = ['somelib'])
  30. bld(
  31. features = 'py',
  32. name = 'pbpy',
  33. source = ['inc/message_inc.proto','inc/message.proto'],
  34. protoc_includes = ['inc'])
  35. bld(
  36. features = 'cxx py',
  37. name = 'pbboth',
  38. source = ['incboth/messageboth_inc.proto', 'incboth/messageboth.proto'],
  39. protoc_includes = ['incboth']) # either protoc_includes or includes would work in this case
  40. bld(
  41. features = 'javac protoc',
  42. name = 'pbjava',
  43. srcdir = 'inc/',
  44. source = ['inc/message_inc.proto', 'inc/message.proto'],
  45. use = 'PROTOBUF',
  46. protoc_includes = ['inc'])