[Scons-users] Retrieving variables

Stefan Seefeld stefan at seefeld.name
Fri Jun 17 15:30:25 EDT 2016


On 17.06.2016 14:35, Bill Deegan wrote:
> Stefan,
>
> Really you're going about this the hard way I think.
> Why reinvent the wheel.
>
> Try using this: (From manpage)
>
> Values of variables to be passed to the SConscript file(s) may be
> specified on the command line:
>
> scons debug=1 .
>
> These variables are available in SConscript files through the
> ARGUMENTS dictionary, and can be used in the SConscript file(s) to
> modify the build in any way:
>
> if ARGUMENTS.get('debug', 0):
>     env = Environment(CCFLAGS = '-g')
> else:
>     env = Environment()

Yes, I could do

  `if ARGUMENTS.get('arch', 'some default')`

but I would have to duplicate the logic to set the default value (which
I already had to add to

  `vars.Add('arch', 'some default')`

which is one of the reasons why I used the term "kludge"...

I admit this is only a minor issue, but still I think SCons should
provide a more elegant way to solve this.

        Stefan



-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Scons-users mailing list