patch: c/cxxflags for static libraries

Brad King brad.king at kitware.com
Tue Jul 18 21:14:03 CEST 2006


Thiago Macieira wrote:
> Brad King wrote:
>> For plain old ADD_LIBRARY, the STATIC option works on all platforms to
>> create a static library.  What is not supported is the "convenience"
>> part that allows multiple static libraries to be "linked" to form a
>> bigger static library, or all the objects in a static archive to be
>> copied into a shared library whether they are referenced or not.
> 
> Right. CMake shouldn't allow one to add a static library as a dependency 
> for anything other than a final executable. I don't know if it does that 
> or not, but it shouldn't.
> 
> libtool allowed that because the dependency was recorded in the .la file. 
> When the final executable was linked, the linking was actually performed.

The equivalent in CMake would be to just remove static libraries from
the list of libraries put on the link line for a shared library.  The
static libraries should still be listed as dependencies so that when the
executable links to the shared library it gets the static library too.

Does this sound correct?

-Brad


More information about the Kde-buildsystem mailing list