[Scons-users] Overriding Object to force global dependency
Greg Ward
greg at gerg.ca
Thu Jul 5 14:41:14 EDT 2012
[my original question from last week]
> I want to force every single *.o file in my build to artificially
> depend on something. (We have a homebrew tool that downloads and
> unpacks specific versions of all third-party dependencies -- GCC,
> C/C++ libraries, Java libraries, etc. This tool must run first, and
> everything else should depend on its output.)
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.
Many thanks --
Greg
More information about the Scons-users
mailing list