[Scons-users] Link program without build directory in link path?

Bill Deegan bill at baddogconsulting.com
Sun Aug 6 14:43:39 EDT 2017


That's exactly how you should do it and it should work on linux, osx, and
windows.
Though of course there are some differences between a unix shared library
and a dll which you'd need to handle no matter how you build it.

Not sure why you think this is not the correct way. It's what's in all the
docs and all the wiki pages.

For libraries, using the return value (an list of Node objects) to link
against is the exception rather than the rule.


-Bil

On Sun, Aug 6, 2017 at 3:33 AM, edA-qa mort-ora-y <eda-qa at disemia.com>
wrote:

> I've manually concatenated the LIBS and it works. But this feels wrong
> somehow, like I'm intentionally avoiding how Scons builds libraries.
>
> My libraries look kind of like this now:
>
>     lib_util_name = 'leaf_util'
>     lib_util = env.SharedLibrary( lib_util_name, [ ... ])
>
> Where I create a name for it since I couldn't find a way to extract this
> name from the target.
>
> Then when using the libraries:
>
>     leaf = env.Program( 'leaf', [
>         'bin/leaf.cpp',
>         'bin/test_expecter.cpp',
>         ],
>         LIBS = env['LIBS'] + [ lib_lang_name, lib_parser_name,
> lib_util_name, lib_ir_name, lib_ir_llvm_name,  lib_runner_name ],
>         )
>
> It works, at least on Linux, but it feels like I'm not using it
> correctly. In particular I don't know how this will translate to the OSX
> run, or eventual other platforms.
>
>
> On 06/08/17 12:26, edA-qa mort-ora-y wrote:
> > I'm having trouble with this approach since setting LIBS=[...] appears
> > to replace the entire libraries list instead of extending it.
> >
> > Sconstruct:
> > https://gist.github.com/mortoray/1bcfb60cfe3c20c2740fd1f8f27442f6
> > Sconscript:
> > https://gist.github.com/mortoray/f56cdbe1fd2b07c030ee5eb129aeaccf
>
> --
> edA-qa mort-ora-y
> http://mortoray.com/
>
> Leaf - the language we always wanted
> http://leaflang.org/
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170806/3d1f5d02/attachment-0001.html>


More information about the Scons-users mailing list