[Scons-users] Linking with target alias

Gary Oberbrunner garyo at oberbrunner.com
Tue Aug 21 08:38:51 EDT 2012


On Tue, Aug 21, 2012 at 5:37 AM, Mariusz Buras <mariusz.buras at gmail.com> wrote:

> Hi there,

>

> Is there a way do something like the pseudo code below?

>

> (some scons script file)

>

> lib = env.StatidLibrary( files )

>

> env.Alias("libalias", lib )

>

> (some other scons script file executed later)

>

> prog = env.Program ( [files, env.Alias("libalias") ])

>

> This would simplify my scons scripts significantly because I wouldn't

> need to export and import targets back and forth.


Not exactly, since there could be other things in that alias. (There
may be an undocumented way to get the contents of an Alias Node, but I
wouldn't go that way if I were you.)

What about:
env['MYLIB'] = env.StaticLibrary(files)[0]
...
env.Program([file1, file2, '$MYLIB'])
or:
env.Program(files, LIBS='$MYLIB')

? (I didn't test that but I think either should work)

--
Gary


More information about the Scons-users mailing list