[Scons-users] Attaching an emitter to an existing builder
Jeremy Elson
jelson at gmail.com
Wed Jan 27 16:30:55 EST 2021
Hi scons gurus,
Is there a way to attach an emitter to a pre-existing builder? I know how
to create my own custom Builders that have emitters, but I'm trying to add
an emitter to one of the standard builders that comes with SCons. I see a
function in Builder called add_emitter, so I tried this:
def map_emitter(target, source, env):
print("emitter is being called")
env["BUILDERS"]["Program"].add_emitter(
suffix = ".map",
emitter = map_emitter)
But it throws an exception:
TypeError: 'EmitterProxy' object does not support item assignment
I'm using the standard SCons Program() Builder to build my program. But I
am also passing a linker option in LINKFLAGS so that when gcc is called at
the link stage, it generates both the program binary as its main output and
also an extra file (a .map file) that contains linker symbol metadata. I
want SCons to understand this side-effect so that if the map file gets
deleted, scons will run gcc again to regenerate it.
Thanks!
-Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20210127/70ca0a23/attachment.html>
More information about the Scons-users
mailing list