[Scons-users] Not clobbering autodetected HOST_ARCH when configured via Options

Gary Oberbrunner garyo at oberbrunner.com
Wed Jul 9 14:38:00 EDT 2014


On Wed, Jul 9, 2014 at 2:07 PM, Andrew C. Morrow <andrew.c.morrow at gmail.com>
wrote:

> ...
> Environment(
>     tools=['tool'],
>     TOOL_OPT=None,
> )
>
> may not be equivalent to
>
> Environment(
>     tools=['tool'],
> )
>
> Which means you can't write:
>
> Environment(
>     tools=['tool'],
>     TOOL_OPT=GetOption('tool-opt'),
> )...
>

Yes, you're right.  The problem is that the tool code is checking for the
_presence_ of that construction variable.  The tools really shouldn't do
that; a better pattern would be
  if env.get('TOOL_OPT'):
rather than
 if TOOL_OPT in env
or whatever it's doing now.

Your **kwargs solution should also work, as a workaround.

-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140709/cef8d8f4/attachment.html>


More information about the Scons-users mailing list