[Scons-users] passing variables on the command-line
Bill Deegan
bill at baddogconsulting.com
Fri Jun 17 14:27:05 EDT 2016
It is valid to have CFLAGS as a string.
-Bill
On Fri, Jun 17, 2016 at 11:10 AM, Stefan Seefeld <stefan at seefeld.name>
wrote:
> Answering my own question again:
>
> It seems
>
> vars.Add('CCFLAGS', converter=lambda v:v.split())
>
> does what I want.
>
> Stefan
>
>
>
> On 17.06.2016 13:54, Stefan Seefeld wrote:
> > In my current build logic I save variables (user-provided as well as
> > configure-computed) to a 'config.py' file. To do this I add
> >
> >
> > vars.Add('CPPPATH')
> >
> >
> > etc. to my SConstruct file, so these variables get properly remembered.
> > After running `scons` the first time (where the configure logic issues a
> > number of env.AddUnique(CCFLAGS='something') calls, I get this in my
> > config.py file:
> >
> >
> > CPPPATH = ['/usr/include/python2.7']
> > CCFLAGS = []
> > LIBPATH = ['/usr/lib64']
> > LIBS = []
> > PYTHON = 'python'
> > PYTHONLIBS = ['python2.7']
> >
> >
> > However, if I run instead something like `scons CCFLAGS=-Wall -W` the
> > result is
> >
> >
> > ...
> >
> > CCFLAGS = '-Wall -W'
> >
> > ...
> >
> >
> > How can I instruct SCons to transform the 'CCFLAGS' variable issued on
> > the command-line into a list, so the individual flags are understood
> > when this is passed to the compiler ?
> >
> >
> > Thanks,
> >
> > Stefan
> >
> >
>
>
> --
>
> ...ich hab' noch einen Koffer in Berlin...
>
> _______________________________________________
> 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/20160617/09d5fdbe/attachment.html>
More information about the Scons-users
mailing list