<div class="gmail_quote">On Tue, Oct 9, 2012 at 12:07 AM, Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

2012/10/9 James Bigler &lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt;:<br>
<div class="im">&gt; In my project I need to manually link against a special version of<br>
&gt; libstdc++, so I manually set the target link language to C and then add my<br>
&gt; special library to the link line.  On Linux this seems to work just fine,<br>
&gt; but on OSX it still add -lstdc++ to the link like.  Here&#39;s my cmake code:<br>
<br>
</div>This doesn&#39;t seem to work on Linux either on my side, stdc++ gets in the link<br>
line as well:<br>
<br>
/usr/bin/cc  -fPIC    -shared -Wl,-soname,liba.so -o liba.so<br>
CMakeFiles/a.dir/a.cpp.o -lstdc++ -lm<br>
<br>
Did you try to fiddle with CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Erk<br>
Le gouvernement représentatif n&#39;est pas la démocratie --<br>
<a href="http://www.le-message.org" target="_blank">http://www.le-message.org</a><br>
</font></span></blockquote></div><br><div>I can manually remove the library thusly:</div><div><br></div><div><div>   list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_LIBRARIES stdc++)</div><div><br></div></div><div>This &quot;works around&quot; the issue, but it is rather ugly (directory scoped rather than target scoped) and non-intuitive (there&#39;s no documentation for this flag - I had to dig it out of emails and source).</div>