[CMake] building on linux, extra libraries referenced

J Decker d3ck0r at gmail.com
Mon Dec 26 02:46:14 EST 2011


I have this huge project that I've been building with cmake; and even
under gcc (mingw) I don't have this problem... but what is happening
is I have a generic list of libraries that I provide for applications
to link against.  This includes the c version and the c++ version of
two libraries.  On Windows, only those libraries that are actually
used are referenced in the final output.  On Linux, with very recent
gcc compilers, the programs end up with references to both libraries,
and both(all 4) libraries are loaded.  I understand that this is
probably a feature of some sort; but now do I specify for ld to only
use the libraries that have referenced symbols in them?


More information about the CMake mailing list