[MacPorts] #59436: libxml2 @2.9.9: libxml2-config.cmake LIBXML2_LIBRARIES includes libxml2's dependencies, which results in overlinking
MacPorts
noreply at macports.org
Wed Oct 23 13:45:58 UTC 2019
#59436: libxml2 @2.9.9: libxml2-config.cmake LIBXML2_LIBRARIES includes libxml2's
dependencies, which results in overlinking
-------------------------+--------------------
Reporter: ryandesign | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.6.2
Resolution: | Keywords:
Port: libxml2 |
-------------------------+--------------------
Comment (by ryandesign):
My understanding is that xml2-config, and other projects' *-config
scripts, print all libraries when using the `--libs` flag, because linking
to a static library requires linking to all of its dependencies as well. I
don't do static libraries so I don't have experience with this myself. For
dynamically linked libraries this is not needed but *-config scripts don't
provide a way for the caller to indicate that the flags will be used for
dynamic linking. pkg-config, on the other hand, prints only the flags
needed for dynamic linking when the `--libs` flag is used, unless the
`--static` flag is also used.
I'm not very familiar with cmake. I have not submitted a PR to change this
cmake file because I do not know how the file is used. If it is ever used
to build static libraries, then the file should not be changed. If it is
used only to build dynamic libraries, then it should be changed.
--
Ticket URL: <https://trac.macports.org/ticket/59436#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list