[Scons-users] Linking with target alias
Mariusz Buras
mariusz.buras at gmail.com
Tue Aug 21 08:59:26 EDT 2012
Thanks for quick answer,
This doesn't seem to work because scons sees '$MYLIB' not as a node
but as a file on disk. At least that what I think is happening because
I get an error message complaining that my /path/to/lib.a is not found
when it tries to link my executable even before it attempts to build
the library. Does anything else spring to mind before I'll roll our my
custom solution?
--
Cheers,
Mariusz Buras.
On 21 August 2012 13:38, Gary Oberbrunner <garyo at oberbrunner.com> wrote:
> 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
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
More information about the Scons-users
mailing list