[Scons-users] How to create multiple tasks/jobs from a single builder invocation

Dirk Bächle tshortik at gmx.de
Wed May 14 03:07:28 EDT 2014


Hi Rocco,

On 14.05.2014 08:46, Matano, Rocco wrote:

> I have written a number of custom scons builders and I think I understand the basic concepts of those.

>

> But now I am facing a task that I don't know how to solve. I would like to write a custom builder that takes

> a list of source files and creates a single scons task / job for each source file, so that scons will work off

> those tasks in parallel if '--jobs=N' was given on the command line.

>

> When compiling C files like this

>

> objs = env.Object(source=['file1.c', 'file2.c', 'file3.c', 'file4.c'])

>

> that parallelism is achieved out of the box.

>

> I would like to write a builder that also achieves that. I would like to be able to invoke that builder similarly:

>

> targets = env.CustumBuilder(source=['file1.ext', 'file2.ext', 'file3.ext', 'file4.ext'])

>

> So my question is:

> What do I have to do when writing a custom builder in order to achieve that parallelism?


if I remember correctly, the Builder() constructor offers a keyword
"single_source", which should do what you want. Please consult the MAN
page additionally.

Best regards,

Dirk




More information about the Scons-users mailing list