[Scons-users] Variables 'Update' not adding variables to environment?
William Blevins
wblevins001 at gmail.com
Mon Jan 25 07:09:04 EST 2016
Please see the User's Guide for information regarding this topic:
http://www.scons.org/doc/HTML/scons-user/ch10s02.html
Here is a snippet:
vars = Variables(None, ARGUMENTS)
vars.Add('RELEASE', 'Set to 1 to build for release', 0)
env = Environment(variables = vars)
On Mon, Jan 25, 2016 at 8:56 AM, James Ramm <James.Ramm at jbarisk.com> wrote:
> Hi
>
> I have the following in my SConstruct:
>
>
>
> opts = Variables()
>
> opts.AddVariables(
>
> PathVariable('GDAL_INCLUDES', 'search path for gdal include files'
> ,'/usr/local/include', PathVariable.PathAccept),
>
> BoolVariable('DEBUG', 'compile in debug mode', 'False'),
>
> )
>
>
>
> env = Environment()
>
> opts.Update(env)
>
I'm not sure what update does off the top of my head, but this isn't how
the User's Guide shows the interaction of Variable and Environment. Try
doing it the way that is shown in the User's Guide and see if that works. I
will look at the Update function.
>
>
> If I then `print env['GDAL_INCLUDES']` I get a key error:
>
>
>
> KeyError: 'GDAL_INCLUDES':
>
> File "…/SConstruct", line 69:
>
> print env['GDAL_INCLUDES']
>
> File "/usr/lib/scons/SCons/Environment.py", line 413:
>
> return self._dict[key]
>
>
>
>
>
> I can, however, do `print env['DEBUG']` and it correctly writes `False`
>
>
>
> Any idea whats going on?
>
>
>
>
>
> Thanks
>
> *James Ramm*
>
> *Software Developer*
>
>
>
> *Find out more about us here: www.jbarisk.com <http://www.jbarisk.com/>
> and **follow us on Twitter @JBARisk <http://twitter.com/JBARisk> and
> LinkedIn
> <https://www.linkedin.com/company/2370847?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2370847%2Cidx%3A2-1-2%2CtarId%3A1447414259786%2Ctas%3AJBA%20RISK%20MANAGEMENT>
> *
>
> The JBA Group supports the JBA Trust.
>
> All JBA Risk Management's email messages contain confidential information
> and are intended only for the individual(s) named. If you are not the named
> addressee you should not disseminate, distribute or copy this e-mail.
> Please notify the sender immediately by email if you have received this
> email by mistake and delete this email from your system.
>
>
> JBA Risk Management Limited is registered in England, company number
> 07732946, South Barn, Broughton Hall, Skipton, North Yorkshire, BD23 3AE, Telephone:
> +441756799919
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160125/ef56308d/attachment-0001.html>
More information about the Scons-users
mailing list