From 926bafc7fbe46e9414366e93a1dbca318718af7e Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 27 Jul 2020 10:06:11 -0600 Subject: Align SetOption doc with settable options list. [skip appveyor] List is recast into a table for readability. Comments in both places remind to keep lists in sync. Signed-off-by: Mats Wichmann --- SCons/Script/Main.xml | 227 ++++++++++++++++++++++--------------------- SCons/Script/SConsOptions.py | 2 +- 2 files changed, 118 insertions(+), 111 deletions(-) diff --git a/SCons/Script/Main.xml b/SCons/Script/Main.xml index 0a8f9dc..1519171 100644 --- a/SCons/Script/Main.xml +++ b/SCons/Script/Main.xml @@ -80,10 +80,10 @@ it will recognize , and so forth as long as there is no other option which could also match to the same abbreviation. Options added via -AddOption do not support +&f-AddOption; do not support the automatic recognition of abbreviations. Instead, to allow specific abbreviations, -include them in the &f-AddOption; call. +include them as synonyms in the &f-AddOption; call itself. @@ -99,7 +99,7 @@ options added with &f-AddOption;. The value may also be set using &f-SetOption; or -env.SetOption(), +&f-env.SetOption;, if conditions in a &SConscript; require overriding any default value. @@ -765,123 +765,130 @@ Multiple targets can be passed in to a single call to -This function provides a way to set a select subset of the scons command -line options from a SConscript file. The options supported are: - - - - - -clean - - -which corresponds to , -and ; - - - - -duplicate - - -which corresponds to ; - - - - -help - - -which corresponds to and ; - - - - -implicit_cache - - -which corresponds to ; - - - - -max_drift - - -which corresponds to ; - - - - -no_exec - - -which corresponds to , , -, -and ; - - - - -num_jobs - - -which corresponds to and ; - - - - -random - - -which corresponds to ; and - - - - -silent - - -which corresponds to . - - - - -no_progress - - -which corresponds to -Q. - - - Note: The initial progress output will still be output as this is done before the SConstruct/SConscript which contains the SetOption is processed - scons: Reading SConscript files ... - -Available since &scons; 4.0. - - - -stack_size - - -which corresponds to --stack-size. - - - - +Sets &scons; option variable name +to value. +These options are all also settable via +&scons; command-line options but the names may differ. +A value set via command-line option will take +precedence over one set with &f-SetOption;, which +allows setting a project default in the scripts and +temporarily overriding it via command line. + + + +The settable variables with their associated command-line options are: + + + + + + + +VariableCommand-line options + + + +clean + +, , + + +diskcheck + + + + +duplicate + + + + +help + +, + + +implicit_cache + + + + + +max_drift + + + + +md5_chunksize + + + + +no_exec + +, , +, , + + + +no_progress + + + + +num_jobs + +, + + +random + + + + +silent + +. + + +stack_size + + + + +warn + +. + + + + + + +See the documentation in the manpage for the +corresponding command line option for information about each specific option. +Option values which are boolean in nature (that is, they are +either on or off) should be set to a true value (True, +1) or a false value (False, +0). + -See the documentation for the -corresponding command line option for information about each specific -option. +If no_progress is set via &f-SetOption; +there will still be initial progress output as &SCons; has +to start reading SConscript files before it can see the +&f-SetOption; in an SConscript file: +scons: Reading SConscript files ... + Example: -SetOption('max_drift', 1) +SetOption('max_drift', True) diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index 9fee74e..e407306 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -126,7 +126,7 @@ class SConsValues(optparse.Values): # is not available. raise AttributeError(attr) - + # keep this list in sync with SetOption doc in SCons/Script/Main.xml settable = [ 'clean', 'diskcheck', -- cgit v0.12 From fb5fdb341325c89878dfa5cc2bbdbe96a360154f Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 29 Jul 2020 08:56:52 -0600 Subject: [PR #3758] be more explicit about syncing SetOption list [ci skip] Signed-off-by: Mats Wichmann --- SCons/Script/Main.xml | 3 ++- SCons/Script/SConsOptions.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SCons/Script/Main.xml b/SCons/Script/Main.xml index 1519171..ed9f6c3 100644 --- a/SCons/Script/Main.xml +++ b/SCons/Script/Main.xml @@ -779,7 +779,8 @@ temporarily overriding it via command line. The settable variables with their associated command-line options are: - + + diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index e407306..cf203e1 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -126,7 +126,8 @@ class SConsValues(optparse.Values): # is not available. raise AttributeError(attr) - # keep this list in sync with SetOption doc in SCons/Script/Main.xml + # keep this list in sync with the SetOption doc in SCons/Script/Main.xml + # search for UPDATE_SETOPTION_DOCS there. settable = [ 'clean', 'diskcheck', -- cgit v0.12 From df8780c8006456e7cd791317c8e92c58d66d7578 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 30 Jul 2020 08:03:13 -0600 Subject: [PR #3758] expand on SetOption limitations [skip appvyor] Signed-off-by: Mats Wichmann --- SCons/Script/Main.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SCons/Script/Main.xml b/SCons/Script/Main.xml index ed9f6c3..8c707d0 100644 --- a/SCons/Script/Main.xml +++ b/SCons/Script/Main.xml @@ -768,11 +768,15 @@ Multiple targets can be passed in to a single call to Sets &scons; option variable name to value. These options are all also settable via -&scons; command-line options but the names may differ. +&scons; command-line options but the variable name +may differ from the command-line option name (see table). A value set via command-line option will take precedence over one set with &f-SetOption;, which allows setting a project default in the scripts and temporarily overriding it via command line. +Options which affect the reading and processing of SConscript files +are not settable this way, since those files must +be read in order to find the &f-SetOption; call. -- cgit v0.12