Search code examples
waf

Setting multiple files as source input generated by a single task generator


A single task generator generates a number of source and header files. The number of generated files is not known at that time. How can I set these generated files as source input?

I used the code shown in the documentation, but this only describes the case a.a → a.b + a.c, but my case is a.a → a lot of files in directory a. Therefore I am not able to use:

b_node = node.change_ext('.b')
c_node = node.change_ext('.c')
self.create_task('idl', node, [b_node, c_node])
self.source.append(b_node)

The example is shown in the documentation here: https://waf.io/book/#_mixing_extensions_and_c_c_features

How can these unknown number of files used as input for self.source.append(**what goes here?**)


Solution

  • Well you should look at §11.4.2: A compiler producing source files with names unknown in advance. The trick is to manage dependencies by overloading runnable_status() and run() methods