[CMake] Convenience lib vs static library

James Mansion james at mansionfamily.plus.com
Sun Nov 23 15:56:24 EST 2008


Andreas Pakulat wrote:
> This is Ok for building an executable, but linking a static lib into a
> shared lib is completely unportable and not supported on all operating
> systems that cmake supports. Thats why its not done.
>
>   
Huh?  I'm not aware of that as a limitation - you *do* need the objects 
in the static library to be
position-independant or otherwise compiled as objects to go into a 
shared library.

I think Oscar is wrong here:

>A convenience library works as an object file at link time: it is
>included on the final executable as any other object file.

Or at least, that's an unnecessarily limited view.  The terminology is 
debatable.

One way or another, it is useful to be able to assemble a collection of 
objects that are
compiled for inclusion into a shared library, into 'something' that the 
linker can
use to source symbols.  The issue here is that the selection of 
compilation flags needs
to be 'as if' making a shared library, and the processing after the 
elements are
compiled needs to be 'as if' creating a static library.

James



More information about the CMake mailing list