[CMake] Adding -fPIC to static libraries

Filipe Sousa filipe at ipb.pt
Wed Mar 1 10:29:41 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

For some reason that I don't understand I have to add -fPIC to static
libraries on AMD64 otherwise I get this message:
relocation R_X86_64_32 against `a local symbol' recompile with -fPIC

If I add -fPIC to CMAKE_C/CXX_FLAGS in the top level CMakeLists works
but for shared libraries -fPIC is added twice.

I see that there is a CMAKE_SHARED_LIBRARY_C_FLAGS variable with
"-fPIC", is there any CMAKE_STATIC_LIBRARY_C_FLAGS so that I can add
"-fPIC"?


- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFEBb3lbQdNYqwwwCwRAroPAJ9gs8/2QCayMlketScrL12LHuV/VACfTE3U
rmmVYiWQ0kWPRMiZMkSfS5I=
=FY5m
-----END PGP SIGNATURE-----


More information about the CMake mailing list