@@ -2981,12 +2981,23 @@ env.Program('bar', source='bar.c foo.c'.split())
29812981
29822982<note >
29832983<para >
2984- Top-relative paths < emphasis role = " bold " > only</ emphasis > work
2984+ Top-relative paths only work
29852985where &SCons; will interpret the path (see examples).
2986- To be used in other contexts the string must first be converted
2987- to a relative or absolute path.
2986+ The string must first be converted
2987+ to a relative or absolute path
2988+ to be used in other contexts
2989+ (such as pure &Python; code that does not
2990+ involve an &SCons; API call),
29882991A suitable string can be extracted from the Node
2989- created from the top-relative path.
2992+ created from a top-relative path.
2993+ Additionally, some paths are handled by &SCons; but
2994+ are not directly build participants,
2995+ so are not evaluated for the <literal >#</literal >
2996+ since no Nodes are created.
2997+ You can explcitly create a &f-link-File; or &f-link-Dir;
2998+ node to force evaluation,
2999+ such as when specifying a path to the derived-file cache:
3000+ <literal >CacheDir(Dir('#cache'))</literal >.
29903001</para >
29913002</note >
29923003
@@ -3012,10 +3023,13 @@ env.Program('#/bar', 'bar.c')
30123023# SConstruct directory) from "subdir/foo.c":
30133024env.Program('#other/foo', 'foo.c')
30143025
3015- # This will not work, only SCons interfaces understand '#',
3016- # os.path.exists is pure Python:
3026+ # os.path.exists() is pure Python, so this fails:
30173027if os.path.exists('#inc/foo.h'):
30183028 env.Append(CPPPATH='#inc')
3029+
3030+ # create a Node to make it work:
3031+ if os.path.exists(File('#inc/foo.h')):
3032+ env.Append(CPPPATH='#inc')
30193033</programlisting >
30203034
30213035<para >
0 commit comments