2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-10 20:29:10 +01:00
waf/demos/csharp/wscript

40 lines
1.1 KiB
Plaintext
Raw Normal View History

2011-09-10 11:13:51 +02:00
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010 (ita)
FRAG = '''
namespace Moo {
public class Test {
public static int Main(string[] args) {
return 0;
}
}
}
'''
def options(opt):
opt.load('cs')
def configure(conf):
conf.load('cs')
try:
conf.check(features='cs', fragment=FRAG, compile_filename='test.cs', gen='test.exe',
csflags=['-pkg:gtk-sharp-2.0'], msg='Checking for Gtksharp support')
conf.env.HAS_GTKSHARP = True
2012-04-23 19:16:56 +02:00
except conf.errors.ConfigurationError:
2011-09-10 11:13:51 +02:00
conf.env.HAS_GTKSHARP = False
def build(bld):
# for system libraries, use:
#bld.read_csshlib('ManagedLibrary.dll', paths=[bld.env.mylibrarypath])
bld(features='cs', source='My.cs Dye.cs', gen='my.dll', name='mylib', csdebug='full')
bld(features='cs', source='Hi.cs', includes='.', gen='hi.exe', use='mylib', name='hi')
bld(features='cs', source='Hi.cs', includes='.', gen='hi-x86.exe', use='mylib', name='hi', platform='x86')
2011-09-10 11:13:51 +02:00
if bld.env.HAS_GTKSHARP:
bld(features='cs', source='Simple.cs', includes='.', gen='mono-hello.exe', csflags=['-pkg:gtk-sharp-2.0'])
# note:
# bld(features='cs', ..., type='module' # or exe, library, winexe, ...