[Scons-users] Overriding Object to force global dependency

Gary Oberbrunner garyo at oberbrunner.com
Thu Jul 5 17:04:04 EDT 2012


On Thu, Jul 5, 2012 at 4:41 PM, Greg Ward <greg at gerg.ca> wrote:

> Argghh. I spoke too soon. When I use this emitter *just* with

> StaticObject, it's fine. But I want it on SharedObject as well as

> StaticObject. So I did this:

>

> def lbe_emitter(target, source, env):

> env.Depends(target, '#dummy-lbe')

> return (target, source)

>

> env['BUILDERS']['StaticObject'].add_emitter('.cpp', lbe_emitter)

> env['BUILDERS']['SharedObject'].add_emitter('.cpp', lbe_emitter)


The standard SharedObjectEmitter does this (see Defaults.py):

def SharedObjectEmitter(target, source, env):
for tgt in target:
tgt.attributes.shared = 1
return (target, source)

and unfortunately I believe add_emitter is replacing the standard
emitter with yours. (See Builder.py). Maybe for now just set
tgt.attributes.shared=1 in your shared emitter.

--
Gary


More information about the Scons-users mailing list