summaryrefslogtreecommitdiff
path: root/SCons/Script
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2022-05-15 09:44:59 -0600
committerMats Wichmann <mats@linux.com>2022-05-25 12:31:18 -0600
commitcdb1d2163a927981e9dab9f977094537e7b0d959 (patch)
tree127711590f40513eb8275d410ea5f3c97d6a287f /SCons/Script
parent5054f7045344e1f9dd4a2154f2191a3459a9ae98 (diff)
downloadscons-git-cdb1d2163a927981e9dab9f977094537e7b0d959.tar.gz
Try to improve variantdir docs [skip appveyor]
Reorder some bits, add some explantaions, include example of passing different environments to subsidiary SConscript. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Script')
-rw-r--r--SCons/Script/SConscript.xml56
1 files changed, 26 insertions, 30 deletions
diff --git a/SCons/Script/SConscript.xml b/SCons/Script/SConscript.xml
index 3c5b907b7..0710ea51e 100644
--- a/SCons/Script/SConscript.xml
+++ b/SCons/Script/SConscript.xml
@@ -368,7 +368,7 @@ Return('val1 val2')
</arguments>
<summary>
<para>
-Execute one or more subsidiary SConscript (configuration) files.
+Executes one or more subsidiary SConscript (configuration) files.
There are two ways to call the
&f-SConscript; function.
</para>
@@ -395,8 +395,8 @@ config = SConscript('MyConfig.py')
<para>
The second way to call
&f-SConscript;
-is to specify a list of (sub)directory names
-as a
+is to specify a list of directory names
+using the
<varname>dirs</varname>=<replaceable>subdirs</replaceable>
keyword argument.
In this case,
@@ -448,38 +448,24 @@ SConscript(dirs=['one', 'two', 'three'], exports='shared_info')
If the optional
<varname>variant_dir</varname>
argument is present, it causes an effect equivalent to the
-&f-link-VariantDir; function.
+&f-link-VariantDir; function,
+but in effect only during the execution of the SConscript file.
The <varname>variant_dir</varname>
-argument is interpreted relative to the directory of the calling
-SConscript file.
-The optional
-<varname>duplicate</varname> argument is
-interpreted as for &f-link-VariantDir;.
-If <varname>variant_dir</varname>
-is omitted, the <varname>duplicate</varname> argument is ignored.
-See the description of
-&f-link-VariantDir;
-below for additional details and restrictions.
-</para>
-
-<para>
-If
-<varname>variant_dir</varname>
-is present,
-the source directory is the directory in which the
-SConscript
-file resides and the
-SConscript
+argument is interpreted relative to the directory of the
+<emphasis>calling</emphasis> SConscript file.
+The source directory is the directory in which the
+<emphasis>called</emphasis> SConscript
+file resides and the SConscript
file is evaluated as if it were in the
<varname>variant_dir</varname>
-directory:
+directory. Thus:
</para>
<example_commands>
SConscript('src/SConscript', variant_dir='build')
</example_commands>
<para>
-is equivalent to
+is equivalent to:
</para>
<example_commands>
@@ -488,9 +474,8 @@ SConscript('build/SConscript')
</example_commands>
<para>
-This later paradigm is often used when the sources are
-in the same directory as the
-&SConstruct;:
+If the sources are in the same directory as the
+&SConstruct;,
</para>
<example_commands>
@@ -498,7 +483,7 @@ SConscript('SConscript', variant_dir='build')
</example_commands>
<para>
-is equivalent to
+is equivalent to:
</para>
<example_commands>
@@ -507,6 +492,17 @@ SConscript('build/SConscript')
</example_commands>
<para>
+The optional
+<varname>duplicate</varname> argument is
+interpreted as for &f-link-VariantDir;.
+If the <varname>variant_dir</varname> argument
+is omitted, the <varname>duplicate</varname> argument is ignored.
+See the description of
+&f-link-VariantDir;
+for additional details and restrictions.
+</para>
+
+<para>
<!--
If
<varname>variant_dir</varname>