diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2012-08-20 23:30:35 +0200 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2012-08-20 23:30:35 +0200 |
commit | 82c4addb364fffb1c647ff7e5fab201000719305 (patch) | |
tree | cc244c59579c58d9e8df6e157d8fc49510e0f494 /doc/user/command-line.in | |
parent | fa0c16e75fd6770db0a9eb67a37a9b420ba3fa4f (diff) | |
parent | 3d529f4ea2b0de42aa2144dbe904e564b7b0b813 (diff) |
Merge tag 'upstream/2.2.0'
Upstream version 2.2.0
Diffstat (limited to 'doc/user/command-line.in')
-rw-r--r-- | doc/user/command-line.in | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/doc/user/command-line.in b/doc/user/command-line.in index 52a61ac..38bea25 100644 --- a/doc/user/command-line.in +++ b/doc/user/command-line.in @@ -1,6 +1,6 @@ <!-- - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -62,7 +62,7 @@ Any command-line argument containing an <literal>=</literal> (equal sign) is considered a variable setting with the form - <varname>variable</varname>=<varname>value</varname> + <varname>variable</varname>=<varname>value</varname>. &SCons; provides direct access to all of the command-line variable settings, the ability to apply command-line variable settings @@ -885,7 +885,7 @@ <scons_example name="Variables1"> <file name="SConstruct" printme="1"> - vars = Variables() + vars = Variables(None, ARGUMENTS) vars.Add('RELEASE', 'Set to 1 to build for release', 0) env = Environment(variables = vars, CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) @@ -902,8 +902,9 @@ <para> This &SConstruct; file first creates a &Variables; object - (the <literal>vars = Variables()</literal> call), - and then uses the object's &Add; + which uses the values from the command-line options dictionary &ARGUMENTS; + (the <literal>vars = Variables(None, ARGUMENTS)</literal> call). + It then uses the object's &Add; method to indicate that the &RELEASE; variable can be set on the command line, and that its default value will be <literal>0</literal> @@ -942,7 +943,7 @@ &PathOption;, &PackageOption; and &AddOptions;. These older names still work, and you may encounter them in older - &SConscript; fles, + &SConscript; files, but they have been officially deprecated as of &SCons; version 2.0. @@ -975,7 +976,7 @@ <scons_example name="Variables_Help"> <file name="SConstruct" printme="1"> - vars = Variables('custom.py') + vars = Variables(None, ARGUMENTS) vars.Add('RELEASE', 'Set to 1 to build for release', 0) env = Environment(variables = vars) Help(vars.GenerateHelpText(env)) @@ -1098,6 +1099,23 @@ <scons_output_command>scons -Q</scons_output_command> </scons_output> + <para> + + Finally, you can combine both methods with: + + </para> + + <screen> + vars = Variables('custom.py', ARGUMENTS) + </screen> + + <para> + + where values in the option file &custom_py; get overwritten + by the ones specified on the command line. + + </para> + </section> <section> |