swig: c(xx) task inherits weight from swig itself

If any weights (i.e. `weight` or `tree_weight`) are set on a swig task
then those weights are passed on to the task created to compile the
wrapper generated by swig.
This commit is contained in:
Daniel Vollmer 2018-03-29 13:11:43 +02:00 committed by ita1024
parent c80722685c
commit a4b0b675cf
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,13 @@ def swig_c(self):
c_tsk = self.generator.c_hook(out_node)
c_tsk.set_run_after(self)
# transfer weights from swig task to c task
if getattr(self, 'weight', None):
c_tsk.weight = self.weight
if getattr(self, 'tree_weight', None):
c_tsk.tree_weight = self.tree_weight
try:
self.more_tasks.append(c_tsk)
except AttributeError: