wscript 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Federico Pellegrin 2017 (fedepell)
  4. """
  5. Example source tree to be used with eclipse extra.
  6. First of all load the extra:
  7. ...
  8. def options(opt):
  9. opt.load('eclipse')
  10. def configure(conf):
  11. conf.load('eclipse')
  12. ...
  13. Then after configuring the project you can anytime run:
  14. waf eclipse
  15. This will generate the needed configuration files for Eclipse:
  16. -) .project is generic Eclipse project file
  17. -) .cproject for C/C++ CDT
  18. -) .classpath for Java JDT
  19. -) .pydevproject for Pydev
  20. If CDT is in the project (so at least one C/C++ build) then CDT builder
  21. will be used to call waf as it is more versatile. If just JDT/PYydev are
  22. used then an Eclipse external builder is defined that calls waf. This is
  23. created in the file .externalToolBuilders/Waf_Builder.launch.
  24. The example contains three directories with different supported languages
  25. to demonstrate the features working for each of them, most importantly the
  26. automatic addition of search paths for each language so referencing objects
  27. or files in the IDE is done correctly. This is equivalent to configure
  28. Eclipse by hand using Project->Properties and then each language menu.
  29. Also the generic invocation for building and cleaning are redefined so
  30. waf is called correctly when the respective actions are requested.
  31. To test just the external builder definition just remove "c" from the
  32. module_list below.
  33. """
  34. module_list = 'c java python'
  35. out = 'build'
  36. def options(opt):
  37. opt.load('eclipse')
  38. # We recurse options in our submodules
  39. opt.recurse(module_list)
  40. def configure(conf):
  41. conf.load('eclipse')
  42. # We recurse configurations in our submodules
  43. conf.recurse(module_list)
  44. def build(bld):
  45. bld.recurse(module_list)