[Scons-users] What is the difference between Variables and Options

Stefan Seefeld stefan at seefeld.name
Fri Jan 1 23:09:02 EST 2016


SCons supports the definition of "options" via AddOption(...) and
"variables" via

  v = Variables()
  env = Environment(variables=v)

How do they relate ? In some sample code I found I find "options" to be
used for the typical command-line options using leading '--' (such as in
`scons --prefix=/usr/bin`), while variables allow the definition of
key/value pairs (such as `scons threading=multi`).

Now I want to provide my own help text via Help(). I have found some
sample code that uses the Variables.GenerateHelpText() method. Elsewhere
I see the use of Options.GenerateHelpText(), so I try to combine both.

That yields a warning "scons: warning: The Options class is deprecated;
use the Variables class instead.".
However, if I try to add the "--python" option as a variable key, I get
the error "scons: *** Illegal Variables.Add() key `--python'".

So I'm clearly missing something. Could someone please help ? What are
options, what are variables, and how do I use them ?

Thanks,
        Stefan

-- 

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



More information about the Scons-users mailing list