[Scons-users] Do not add a Tool to an Environment multiple times

Mike Haboustak haboustak at gmail.com
Fri Dec 6 11:42:38 EST 2019


Bill,

On Fri, Dec 06, 2019 at 11:06:47AM -0500, Bill Deegan wrote:
> Simplified logic
> 
> if 'this_tool' in env['TOOLS']:
>    return.

The tool name is added to env['TOOLS'] prior to calling generate()[1], so
a check for existence doesn't work. Changing to AppendUnique makes sense
to me and would be appreciated. A bonus is that when the tool is ultimately
added multiple times there aren't redundant entries in TOOLS.

Mike

[1] https://github.com/SCons/scons/blob/714d2c0baf5573c32bf709f3d252496c2359b345/src/engine/SCons/Tool/__init__.py#L292



More information about the Scons-users mailing list