Skip to content

Commit b5a2151

Browse files
committed
Update Pre/PostAction Alias note [skip appveyor]
The initial version of PR #4872 proposed to document that pre- and post-actions on an alias have no effect if the alias has no action itself. Subsequently, PR #4874 was merged to change this behavior so that statement is backed out, but the other proposed doc improvements in this area are retained. Signed-off-by: Mats Wichmann <mats@linux.com>
1 parent e5f0cf4 commit b5a2151

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

CHANGES.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
200200
attribute and to explain what's being done in the example.
201201
- Test framework reformatted using settings from pyproject.toml.
202202
Includes code embedded in docstrings.
203-
- Clarify that pre/post actions on an alias apply to the alias'
204-
action, not to any targets the alias may refer to (doc).
203+
- Clarify how pre/post actions on an alias work.
205204

206205
From Adam Scott:
207206
- Changed Ninja's TEMPLATE rule pool to use `install_pool` instead of

RELEASE.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ DOCUMENTATION
226226
being created from '${SOURCE.base}.out' to use a valid special
227227
attribute and to explain what's being done in the example.
228228

229-
- Clarify that pre/post actions on an alias apply to the alias'
230-
action, not to any targets the alias may refer to.
229+
- Clarify how pre/post actions on an alias work.
231230

232231
DEVELOPMENT
233232
-----------

SCons/Environment.xml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,7 @@ AddPostAction(foo, Chmod('$TARGET', "a-x"))
380380
<para>
381381
If a <parameter>target</parameter> is an Alias target,
382382
<parameter>action</parameter> is associated with the
383-
action of the alias,
384-
not of any targets that alias may refer to.
385-
Thus, &AddPostAction; will have no effect
386-
if called on an alias which has no action.
383+
action of the alias, if specified.
387384
</para>
388385

389386
</summary>
@@ -425,10 +422,13 @@ before the action step that specifically
425422
generates the specified target(s).
426423
It may not always be obvious
427424
if the process is multi-step - for example,
428-
when building an executable program from a specified source
429-
<filename>.c</filename>
430-
file, &scons; will build an intermediate object file first,
431-
and the pre-action will follow this.
425+
if you use the &Program; builder to
426+
construct an executable program from a
427+
<filename>.c</filename> source file,
428+
&scons; builds an intermediate object file first;
429+
the pre-action is invoked after this step
430+
and just before the link command to
431+
generate the executable program binary.
432432
Example:
433433
</para>
434434

@@ -437,17 +437,6 @@ foo = Program('foo.c')
437437
AddPreAction(foo, 'echo "Running pre-action"')
438438
</example_commands>
439439

440-
<para>
441-
The specified pre-action is executed before
442-
&scons;
443-
calls the link command that actually
444-
generates the executable program binary
445-
<filename>foo</filename>,
446-
but after compiling the
447-
<filename>foo.c</filename>
448-
file into an object file:
449-
</para>
450-
451440
<screen>
452441
$ scons -Q
453442
gcc -o foo.o -c foo.c
@@ -459,10 +448,7 @@ gcc -o foo foo.o
459448
<para>
460449
If a <parameter>target</parameter> is an Alias target,
461450
<parameter>action</parameter> is associated with the
462-
action of the alias,
463-
not with any targets that alias may refer to.
464-
Thus, &AddPreAction; will have no effect
465-
if called on an alias which has no action.
451+
action of the alias, if specified.
466452
</para>
467453

468454
</summary>

0 commit comments

Comments
 (0)