6 Support for the boo programming language, for example::
8 bld(features = "boo", # necessary feature
9 source = "src.boo", # list of boo files
10 gen = "world.dll", # target
11 type = "library", # library/exe ("-target:xyz" flag)
12 name = "world" # necessary if the target is referenced by 'use'
16 from waflib
import Task
17 from waflib
.Configure
import conf
18 from waflib
.TaskGen
import feature
, after_method
, before_method
, extension
21 def boo_hook(self
, node
):
22 # Nothing here yet ...
23 # TODO filter the non-boo source files in 'apply_booc' and remove this method
27 @before_method('process_source')
29 """Create a booc task """
30 src_nodes
= self
.to_nodes(self
.source
)
31 out_node
= self
.path
.find_or_declare(self
.gen
)
33 self
.boo_task
= self
.create_task('booc', src_nodes
, [out_node
])
35 # Set variables used by the 'booc' task
36 self
.boo_task
.env
.OUT
= '-o:%s' % out_node
.abspath()
38 # type is "exe" by default
39 type = getattr(self
, "type", "exe")
40 self
.boo_task
.env
.BOO_TARGET_TYPE
= "-target:%s" % type
43 @after_method('apply_boo')
46 boo applications honor the **use** keyword::
48 dep_names
= self
.to_list(getattr(self
, 'use', []))
49 for dep_name
in dep_names
:
50 dep_task_gen
= self
.bld
.get_tgen_by_name(dep_name
)
54 dep_task
= getattr(dep_task_gen
, 'boo_task', None)
57 dep_task
= getattr(dep_task_gen
, 'cs_task', None)
60 dep_task
= getattr(dep_task
, 'link_task', None)
64 self
.boo_task
.set_run_after(dep_task
) # order
65 self
.boo_task
.dep_nodes
.extend(dep_task
.outputs
) # dependency
66 self
.boo_task
.env
.append_value('BOO_FLAGS', '-reference:%s' % dep_task
.outputs
[0].abspath())
68 class booc(Task
.Task
):
69 """Compiles .boo files """
71 run_str
= '${BOOC} ${BOO_FLAGS} ${BOO_TARGET_TYPE} ${OUT} ${SRC}'
75 self
.find_program('booc', 'BOOC')
76 self
.env
.BOO_FLAGS
= ['-nologo']
79 """Check that booc is available """