On Tue, Oct 9, 2012 at 12:07 AM, Eric Noulard <eric.noul...@gmail.com>wrote:

> 2012/10/9 James Bigler <jamesbig...@gmail.com>:
> > In my project I need to manually link against a special version of
> > libstdc++, so I manually set the target link language to C and then add
> my
> > special library to the link line.  On Linux this seems to work just fine,
> > but on OSX it still add -lstdc++ to the link like.  Here's my cmake code:
>
> This doesn't seem to work on Linux either on my side, stdc++ gets in the
> link
> line as well:
>
> /usr/bin/cc  -fPIC    -shared -Wl,-soname,liba.so -o liba.so
> CMakeFiles/a.dir/a.cpp.o -lstdc++ -lm
>
> Did you try to fiddle with CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ?
>
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>

I can manually remove the library thusly:

   list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_LIBRARIES stdc++)

This "works around" the issue, but it is rather ugly (directory scoped
rather than target scoped) and non-intuitive (there's no documentation for
this flag - I had to dig it out of emails and source).
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to