[Scons-users] Question on custom builder

syost at triad.rr.com syost at triad.rr.com
Fri Dec 22 11:45:22 EST 2017


I have the following code

myBld = Builder(action = udb_precompile,
                suffix='.c',
                src_suffix='.sc',
                emitter = udb_emitter)
rootEnv.Append( BUILDERS = {'UDBPrep' : myBld } )

I call it like so:
newlyCreatedTargets = UDBPrep(Glob('*.sc'))

The builder function simply calls a script with each source as a parameter and the emitter simply adds the secondary target that is also created ("*.bnd" suffix) by the script using target.append().  The target list ends up like this:

source=[files.sc, file2.sc, file3.sc]
target=[file1.c, file1.bnd, file2.bnd, file3,bnd]

as you can see, I don't have all my *.c targets in the target list - just the first one (they do get created by the script).  If I call the builder individually for each source file it works perfect but I take a performance hit for this.  Any ideas?

Thanks in advance!!!!

Spencer


More information about the Scons-users mailing list