"Brandon Van Every" <[EMAIL PROTECTED]> writes:

> On 9/13/07, Juan Sanchez <[EMAIL PROTECTED]> wrote:
>> The statement in the FAQ is untrue:
>>
>> >> That means I have to build all my library objects twice, once for shared
>> >> and once for static. I don't like that!
>>
>> This statement may also be a dealbreaker for those maintaining huge
>> projects.
>
> You know, if you're as huge as AMD, you've got the bucks to find
> workarounds.  You could even pay Kitware to implement something
> better.  The vast majority of CMake developers should be doing
> whatever works reliably.
>
>> If we choose to use the exact same flags, why shouldn't we be able to
>> choose to create the shared library from the archive?

If you are involved in such a big project and still don't know that
you can't use the exact same flags for static and dynamic then lets
hope I never have to use it. I was positivly surprised how automatic
building static and dynmic libs works in cmake.

For dynamic code (in C/C++/obj-c/fortran/anythign with C linkage) you
must use -fPIC or variant thereof because otherwise your jump labels
will be too small and linking will fail sometimes on x86, nearly
always on amd64, ppc, always on ia64, hppa, ...

And if you build static code with -fPIC then you get the reverse on
some archs and loose, some claim up to 30%, speed on x86 and amd64.


Consider yourself lucky you only have to build 2 versions. You might
have to build a dynamic library (*.so), a static library for use in static
linking (*.a) and a static library for use in dynamic linking
(*_pic.a, to link into another dynamic lib or library reduction in an
installer image).

MfG
        Goswin
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to