Skip to content

Commit 086a92b

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 04a42e5 commit 086a92b

File tree

3 files changed

+11
-25
lines changed

3 files changed

+11
-25
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
1818
From Mats Wichmann:
1919
- Fix typos in CCFLAGS test. Didn't affect the test itself, but
2020
didn't correctly apply the DefaultEnvironment speedup.
21-
- Clarify that pre/post actions on an alias apply to the alias' action.
21+
- Clarify how pre/post actions on an alias work.
2222

2323

2424
RELEASE 4.9.0 - Sun, 02 Mar 2025 17:22:20 -0700

RELEASE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ DOCUMENTATION
5353
typo fixes, even if they're mentioned in src/CHANGES.txt to give
5454
the contributor credit)
5555

56-
- Clarify that pre/post actions on an alias apply to the alias' action.
56+
- Clarify how pre/post actions on an alias work.
5757

5858
DEVELOPMENT
5959
-----------

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)