[CMake] Adding -fPIC to static libraries

Prakash Punnoor prakash at punnoor.de
Wed Mar 1 14:17:21 EST 2006


Am Mittwoch März 1 2006 20:04 schrieb Brad King:
> Prakash Punnoor wrote:
> > Am Mittwoch März 1 2006 19:20 schrieb William A. Hoffman:
> >>At 11:29 AM 3/1/2006, Prakash Punnoor wrote:
> >>>(That's why libtool makes one's life so much easier as you don't have to
> >>>think about such problems anymore...)
> >>
> >>What does libtool do to help here?
> >
> > If you use libtool libs *all* the time, things will just work, no matter
> > if you link statically or shared.
>
> How does it know whether to build a static library (no -fPIC) or an
> archive of shared objects (with -fPIC)?  When building the library there
> is no way to know whether it will ever be linked into a shared library
> unless someone provides the information.

Actually I don't know. :-) Or perhaps I confused its behaviour while building 
a project as such. Here at least it is no problem if you have some libtool 
libs declared within the porject and link them either static or shared with 
executables or libs within the same project. I have to test whether it also 
works once you have installed the libs.

Would this work with cmake? Don't I have to work-around this by compiling 
seperate static / shared libs and explicitly state which of the ones I want 
to link in?

-- 
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060301/d071a10c/attachment.pgp


More information about the CMake mailing list