wscript 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2010 (ita)
  4. FRAG = '''
  5. namespace Moo {
  6. public class Test {
  7. public static int Main(string[] args) {
  8. return 0;
  9. }
  10. }
  11. }
  12. '''
  13. def options(opt):
  14. opt.load('cs')
  15. def configure(conf):
  16. conf.load('cs')
  17. try:
  18. conf.check(features='cs', fragment=FRAG, compile_filename='test.cs', gen='test.exe',
  19. csflags=['-pkg:gtk-sharp-2.0'], msg='Checking for Gtksharp support')
  20. conf.env.HAS_GTKSHARP = True
  21. except conf.errors.ConfigurationError:
  22. conf.env.HAS_GTKSHARP = False
  23. def build(bld):
  24. # for system libraries, use:
  25. #bld.read_csshlib('ManagedLibrary.dll', paths=[bld.env.mylibrarypath])
  26. bld(features='cs', source='My.cs Dye.cs', gen='my.dll', name='mylib', csdebug='full')
  27. bld(features='cs', source='Hi.cs', includes='.', gen='hi.exe', use='mylib', name='hi')
  28. bld(features='cs', source='Hi.cs', includes='.', gen='hi-x86.exe', use='mylib', name='hi', platform='x86')
  29. if bld.env.HAS_GTKSHARP:
  30. bld(features='cs', source='Simple.cs', includes='.', gen='mono-hello.exe', csflags=['-pkg:gtk-sharp-2.0'])
  31. # note:
  32. # bld(features='cs', ..., type='module' # or exe, library, winexe, ...