diff options
| author | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:28 +0000 |
|---|---|---|
| committer | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:28 +0000 |
| commit | 0ed55e71a9f4b9cda836c6a4a5408cece60db0c6 (patch) | |
| tree | b1e82f6e428ac15ed9b4de93e48d8079420d537d /doc/user/nodes.in | |
| parent | fe00e4f75ba00298c30d6854b245c2a42c6542b8 (diff) | |
| parent | 738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (diff) | |
Merge commit 'upstream/2.0.0'
Diffstat (limited to 'doc/user/nodes.in')
| -rw-r--r-- | doc/user/nodes.in | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/user/nodes.in b/doc/user/nodes.in index e583ea9..c65a2ad 100644 --- a/doc/user/nodes.in +++ b/doc/user/nodes.in @@ -332,6 +332,51 @@ </section> + <section> + <title>&GetBuildPath;: Getting the Path From a &Node; or String</title> + + <para> + + <function>env.GetBuildPath(file_or_list)</function> + returns the path of a &Node; or a string representing a + path. It can also take a list of &Node;s and/or strings, and + returns the list of paths. If passed a single &Node;, the result + is the same as calling <literal>str(node)</literal> (see above). + The string(s) can have embedded construction variables, which are + expanded as usual, using the calling environment's set of + variables. The paths can be files or directories, and do not have + to exist. + + </para> + + <scons_example name="GetBuildPath"> + <file name="SConstruct" printme="1"> + env=Environment(VAR="value") + n=File("foo.c") + print env.GetBuildPath([n, "sub/dir/$VAR"]) + </file> + </scons_example> + + <para> + + Would print the following file names: + + </para> + + <scons_output example="GetBuildPath" os="posix"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> + + <para> + + There is also a function version of &GetBuildPath; which can + be called without an &Environment;; that uses the default SCons + &Environment; to do substitution on any string arguments. + + </para> + + </section> + <!-- <section> |
