[CMake] Bad documentation of the LINK_INTERFACE_LIBRARIES property and other transitive linking topics

Hendrik Sattler post at hendrik-sattler.de
Thu Nov 24 02:20:54 EST 2011


Am 23.11.2011 22:35, schrieb Michael Hertling:
> Out of curiosity - I have not worked with RPM for ages: Are these
> warnings and the related overlinking due to transitive dependencies
> really an issue or just an inconvenience? Personally, I distinguish
> between real overlinking, i.e. pulling in libraries not used at all,
> and formal overlinking by DT_NEEDED tags for mediate prerequisites,
> or in other words: Real overlinking means the dependency graph has
> unnecessary nodes, and formal overlinking means is has unnecessary
> edges. Of course, the former is a real penalty, but is the latter
> also bad? If an executable X is linked against a shared library B,
> and B against a shared A, is it really critical if A explicitly
> appears among the dependencies of X, as A *is* needed for X?
> Perhaps, you can share some experiences from your practice.

Note that Debian also warn about this.
The issue is the packaging in distributions. When application A depends 
on library B (which depends on library C) but links to both B and C, you 
have to rebuild A and B when the ABI of C changes. If A only links to B, 
only B has to be rebuilt and the distribution user has to download far 
less. So it is an optimisation of many ressources which consumes less 
energy -> good :-)

BTW: linking plugins against an executable is really not good style. 
Put the common part into a library and link the executable and the 
plugin against that library.

HS



More information about the CMake mailing list