[QBS] Linking inter-dependent libraries using gcc
villytiger at gmail.com
Mon Aug 10 11:16:45 CEST 2015
2015-08-09 18:53 GMT+03:00 Richard Weickelt <richard at weickelt.de>:
> > I'm trying to link inter-dependent libraries, but as qbs merges the list
> > libraries it seems to be impossible now.
> I had a somehow related question some time ago  and created QBS-701 
> which You may want to support. It addresses the same procedure.
Thanks for the links. I think whole-archive isn't completely the same
option as start/end-group, but in my particular case it would really solve
> > For example there are two libraries: liba.a and libb.a. liba.a uses
> > from libb.a and libb.a uses symbols from liba.a. Then using gcc they
> must be
> > linked with the following command line: "-la -lb -la".
> ... or by the use of --start-group and --end-group 
> > But I can't get this
> > behavior using cpp.staticLibraries property, because qbs passes each
> > only once. So in such situation the only way is to use low level
> You could try an intermediate static library product with dependencies to
> all Your external archives so that these are linked together into one
> comprehensive archive. But I'm not sure, if the existing linker rules in
> would produce the desired result.
Unfortunately current static library linker rule just sets
cpp.staticLibraries property for the output artifact. So again I would get
each library specified once in linker options.
> > Things become more complicated if one of this libraries is produced by
> > while another one is an external library. I don't know how to workaround
> > such case without using qbs internals (artifact paths).
> Again, could intermediate products help here?
This case is what I have in my project. I could solve this by writing a
rule for merging two libraries by hand. But I think qbs must provide
built-in tool for this.
> > And finally two inter-dependent libraries built by qbs would produce
> > cycle error.
> Could You maybe solve A<--B<--A by splitting A into A1 and A2 (but pointing
> to the same code) and B only depending on the headers of A1 whereas A2
> depends on B?
Indeed this case could be solved by reorganizing source code. But qbs may
provide some tool for this case too.
>  https://bugreports.qt.io/browse/QBS-701
> QBS mailing list
> QBS at qt-project.org
С уважением, / Best regards
Любимов Илья / Ilya Lyubimov
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qbs