[Scons-users] Overriding Object to force global dependency

William Deegan bill at baddogconsulting.com
Sun Jul 8 18:26:34 EDT 2012


Greg,
On Jul 5, 2012, at 1:41 PM, Greg Ward wrote:


> On 05 July 2012, Greg Ward said:

>> On 29 June 2012, Pawel Tomulik said:

>>> It may be possible to use emitter for your purpose, I think.

>>> Dee API docs for SCons.Builder.BuilderBase, especially add_emitter()

>>> method. Try something like:

>>>

>>> def my_emitter(target, source, env):

>>> env.Depends(target, 'foo.txt')

>>> return target, source

>>>

>>> env = Environment()

>>>

>>> env['BUILDERS']['StaticObject'].add_emitter('.c', my_emitter)

>>> ob = env.Object('a.c')

>>

>> Awesome! That worked perfectly right out of the gate.

>

> 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)


Shouldn't you just be adding env.File('#dummy-lbe') to the list of sources?
What's the purpose of #dummy-lbe?

-Bill


More information about the Scons-users mailing list