[QBS] Linking inter-dependent libraries using gcc
villytiger at gmail.com
Mon Aug 10 14:41:38 CEST 2015
2015-08-10 14:53 GMT+03:00 Oswald Buddenhagen <
oswald.buddenhagen at theqtcompany.com>:
> On Mon, Aug 10, 2015 at 01:10:33PM +0300, Ilya Lyubimov wrote:
> > 2015-08-10 12:42 GMT+03:00 Oswald Buddenhagen <
> > oswald.buddenhagen at theqtcompany.com>:
> > > On Mon, Aug 10, 2015 at 12:16:45PM +0300, Ilya Lyubimov wrote:
> > > > 2015-08-09 18:53 GMT+03:00 Richard Weickelt <richard at weickelt.de>:
> > > > > 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.
> > > >
> > > i disagree. no software needs to support every braindead requirement.
> > > and circular dependencies are beyond braindead.
> > >
> > So you offer not to use such libraries? What if they contain millions of
> > lines of useful code? This is very common problem in unix world.
> the primary recourse is to complain to the vendor to fix their garbage.
> if you have the sources, you can either
> - build all of them as a single library or
> - split them sanely into more libraries
> in a rather easy way.
> if you don't have the sources, you can still use either solution by
> repacking the objects (as part of the project build or outside), which
> is what you suggested yourself iiuc.
> for a problem that shouldn't exist in the first place, a hard and hacky
> "solution" is just the right treatment.
On the one hand I agree with you. In the ideal world there would be no such
problem. But on the other hand, I have the large framework which has
everything what my project needs, but it has a little defect - it relies on
gcc feature that allows linking cyclic dependencies. I couldn't merge
libraries beforehand, because one of them must be parametrized at a build
time, while the other one is built separately from my project.
There is no such problem when I use Visual Studio linker. There would be no
such problem if gcc had 2-pass linker. But gcc provides an easy way to link
interdependent libraries. May be it's better to implement this feature in
qbs than writing custom rules for repacking libraries. At some point it
could become easier to use hacky ugly build tools (CMake for example) that
provide a way to pass any options to compiler/linker rather than writing
tons of code to workaround a small issue.
> QBS mailing list
> QBS at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qbs