3 # Thomas Nagy, 2006 (ita)
7 import TaskGen
, Utils
, Task
, Options
9 from TaskGen
import before
, after
, taskgen
, feature
11 flag_vars
= ['FLAGS', 'ASSEMBLIES']
23 def apply_uselib_cs(self
):
27 for var
in self
.to_list(self
.uselib
):
28 for v
in self
.flag_vars
:
29 val
= self
.env
[v
+'_'+var
]
30 if val
: self
.env
.append_value(v
, val
)
33 @after('apply_uselib_cs')
36 try: self
.meths
.remove('apply_core')
37 except ValueError: pass
39 # process the flags for the assemblies
40 for i
in self
.to_list(self
.assemblies
) + self
.env
['ASSEMBLIES']:
41 self
.env
.append_unique('_ASSEMBLIES', '/r:'+i
)
43 # process the flags for the resources
44 for i
in self
.to_list(self
.resources
):
45 self
.env
.append_unique('_RESOURCES', '/resource:'+i
)
47 # what kind of assembly are we generating?
48 self
.env
['_TYPE'] = getattr(self
, 'type', 'exe')
51 self
.env
.append_unique('_FLAGS', self
.to_list(self
.flags
))
52 self
.env
.append_unique('_FLAGS', self
.env
.FLAGS
)
55 nodes
= [self
.path
.find_resource(i
) for i
in self
.to_list(self
.source
)]
56 self
.create_task('mcs', nodes
, self
.path
.find_or_declare(self
.target
))
58 Task
.simple_task_type('mcs', '${MCS} ${SRC} /target:${_TYPE} /out:${TGT} ${_FLAGS} ${_ASSEMBLIES} ${_RESOURCES}', color
='YELLOW')
61 csc
= getattr(Options
.options
, 'cscbinary', None)
64 conf
.find_program(['gmcs', 'mcs'], var
='MCS')
67 opt
.add_option('--with-csc-binary', type='string', dest
='cscbinary')