wscript 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #! /usr/bin/env python
  2. ##
  3. # This wscript shows the power of the CLI!
  4. # You have an hello.exe using a world.dll,
  5. # the world.dll can be generating using
  6. # world.cs (in C#) or world.boo.
  7. top = '.'
  8. out = 'build'
  9. def options(opt):
  10. opt.load('cs')
  11. opt.add_option("--use-cs", dest="use_cs", action="store_true",
  12. help="use world.cs to generate world.dll")
  13. def configure(conf):
  14. conf.env.USE_CS = conf.options.use_cs
  15. if conf.env.USE_CS:
  16. conf.load('cs')
  17. conf.load('boo')
  18. def build(bld):
  19. if bld.env.USE_CS:
  20. # C# world library
  21. bld(features = "cs",
  22. source = "world.cs",
  23. type = "library",
  24. gen = "world.dll",
  25. name = "world"
  26. )
  27. else:
  28. # boo world library
  29. bld(features = "boo",
  30. source = "world.boo",
  31. type = "library",
  32. gen = "world.dll",
  33. name = "world"
  34. )
  35. # executable that uses the world library
  36. bld(features = "boo",
  37. source = "hello.boo",
  38. type = "exe",
  39. gen = "hello.exe",
  40. use = "world"
  41. )