Oliver Dole wrote:
2007/11/27, Daniel Rueckert <[EMAIL PROTECTED]>:
Hi,

I am trying to build some statically linked executables on a linux
box. I have added the "-static" option to the linker flags and specified
static link libraries but for some reason cmake still adds the option
"-Wl,-Bdynamic" flag to the linker options. Is there any way around this?

Thanks, Daniel
Hello,

I exactly face the same problem with cmake-2.4.6:
http://www.sand-labs.org/owb/ticket/160
But I assure that it perfectly worked with cmake-2.4.3. So is there a
regression between cmake-2.4.3 and cmake-2.4.6 or a new way to manage
static link that I have missed (and so my CMakeFiles are not valid
anymore)?


A change was made to make sure that CMake picks the libraries you specified. So, if you have /usr/lib/libfoo.so, CMake will add -Wl,-dynamic -lfoo around foo. But if you have /usr/lib/libfoo.a, then cmake will add -Wl,-static -lfoo around foo. So, if CMake is given a full path to a shared library it will add -Wl,-dyanmic around it.

-Bill
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to