wscript 637 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. #Demo on embedding resources in executables
  3. """
  4. We embed the main.c source code in a section of the program.
  5. See http://gareus.org/wiki/embedding_resources_in_executables
  6. TODO: support for more toolchains
  7. """
  8. from waflib import Task
  9. from waflib.TaskGen import feature, before_method
  10. def options(opt):
  11. opt.load('compiler_c')
  12. opt.load('file_to_object')
  13. def configure(cfg):
  14. cfg.load('compiler_c')
  15. cfg.load('file_to_object')
  16. def build(bld):
  17. bld(
  18. name='example',
  19. source='main.c',
  20. features='file_to_object',
  21. )
  22. bld(
  23. target = 'app',
  24. features = 'c cprogram',
  25. source = 'main.c',
  26. use='example',
  27. )