I am evaluating waf build for an existing project that has tasks similar to that:
1. preprocessing phase: datafile => TransformationTask => library name list
2. for each library name:
2.1 import files from repository
2.2 build library
The library list depends on the preprocessing task and is naturally not known in advance.
How can this be achieved with waf?
You have to generate a file with the library list with a first task. Another task will have the output of the first as an input and will process the corresponding file if needed to generate what you need.
It is somehow the example given in §11.4.2 of the waf book. You have to replace the compiler output parsing with your library description file parsing. You need to copy the example and change the
runmethod inmytool.pylike:In the wscript, I simulate the datafile transformation with a copy.:
With a simple my_lib.json:
And files repo/f1.c and repo/f2.c like
void f1(){}andvoid f2(){}