[Scons-users] Cyclic references between lib archives
me at ikravets.com
Sun Feb 8 16:08:13 EST 2015
> On Feb 5, 2015, at 00:33, Dirk Bächle <tshortik at gmx.de> wrote:
> On 04.02.2015 23:20, Ivan Kravets wrote:
>> Hm... I don't like to change "core logic" in the 3-rd party tool, like SCons. I prefer to use "PUBLIC" access, without modifying "PRIVATE" field.
>> If I will modify "LINCOM" variable, then the only one working solution is add "cyclic" libs before _LIBFLAGS:
>> _LIBFLAGS="-Wl,--start-group $STATIC_LIBS -Wl,--end-group "
>> This works good!
>> Tell me please, is it safe way?
> SCons is setting up an Environment for you with default values, and you're always free to change the available env vars afterwards. As long as it works for you, it's allowed. ;)
> If you're concerned about overwriting your "base" environment, either Clone() it and work on a copy (e.g. staticLibEnv = env.Clone()), or use the feature of appending variable overrides to your Builder call:
> env.Program('myexe', Glob('*.c'), _LIBFLAGS = '-Wl,--start-group $STATIC_LIBS -Wl,--end-group ' + env.subst('$_LIBFLAGS'))
I found interesting issue: when I clean SCons project then the $STATIC_LIBS (which are array/list with bunch of env.Library() result) aren't building...
When I pass them directly to $LIBS, then they are building... Can I trigger SCons to build list of libs from $STATIC_LIBS ?
With best regards, Ivan Kravets
- "Creativity comes from talent and never from knowledge" (c)
More information about the Scons-users