[CMake] Xcode C++ linking

Michael Wild themiwi at gmail.com
Wed Mar 2 04:12:43 EST 2011


On 03/02/2011 10:05 AM, Robert Bielik wrote:
> Michael Wild skrev 2011-03-02 10:02:
>> Probably this means to add -fvisibility=hidden and -static. However,
>> -static will cause you to link everything statically, which will fail if
>> you pass a dynamic library to target_link_libraries().
> 
> Ok, thanks, I'll try add this as target link properties in
> LINK_FLAGS_RELEASE. The linking in itself worked fine when changed
> directly in Xcode.
> 
> Regards,
> /Rob

You could also look at the link flags used by Xcode to find out what it
does.

Newer versions of g++ (4.5, I think) support -static-stdc++, but that is
also only useful if you don't link against a shared C++ library.

Michael


More information about the CMake mailing list