Hi,<div><br></div><div><div class="gmail_quote">On Thu, May 19, 2011 at 7:30 PM, Óscar Fuentes <span dir="ltr"><<a href="mailto:ofv@wanadoo.es">ofv@wanadoo.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">arrowdodger <<a href="mailto:6yearold@gmail.com">6yearold@gmail.com</a>> writes:<br>
<br>
> On Thu, May 19, 2011 at 8:28 PM, Óscar Fuentes <<a href="mailto:ofv@wanadoo.es">ofv@wanadoo.es</a>> wrote:<br>
><br>
>> The name liblibclang is forced by an unfortunate collision between MS<br>
>> and GNU name conventions. We can't create clang.dll with MS since we<br>
>> already have clang.exe on the same directory (.pdb, .ilk and possibly<br>
>> other files collide) so we must use some other name for clang.dll, like<br>
>> libclang.dll. Then this produces liblibclang.so on GNU.<br>
>><br>
><br>
> I've wanted to ask earleir, but forgot about it:<br>
> Why we can't produce libclang.dll on Win and clang.so on Unixies?<br>
<br>
</div></div>For the resason explained on the text you didn't quote. The user would<br>
need to be aware of the difference and do:<br>
<br>
if( MSVC )<br>
  target_link_libraries(myproject libclang)<br>
else()<br>
  target_link_libraries(myproject clang)<br>
endif()<br>
<br>
</blockquote><div><br></div><div><div>FWIW, one could use something like:</div><div><br></div><div><div>if(MSVC)</div><div>set(CMAKE_SHARED_LIBRARY_PREFIX "lib")</div><div>endif()</div><div><br></div><div>This apparently builds "libxyz.dll" with "xyz.lib" import library. .ilk & .pdb also have "lib" prefix in this case so there's no potential clash with clang.exe.</div>
<div>User would then need to have only target_link_libraries(myproject clang) on all platforms. <a href="http://www.vtk.org/Wiki/CMake_Useful_Variables#Prefixes.2C_Suffixes_.28Postfixes.29.2C_and_Extensions">http://www.vtk.org/Wiki/CMake_Useful_Variables#Prefixes.2C_Suffixes_.28Postfixes.29.2C_and_Extensions</a> (they say it's read only var there, but apparently works)</div>
<div><br></div><div>Cheers,</div><div>Dean</div><div><br></div></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Of course this is not a reason that makes impossible to do what you<br>

suggest. I picked a trade-off. If the consensus is that using different<br>
names is the right thing, it's okay with me. However, I don't accept<br>
reasonings of the type: "since I only work on Linux I don't care about<br>
whatever problems Windows users may have." Please keep in mind that for<br>
MSVC users cmake is the only way of building LLVM/Clang.<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>