[cfe-dev] Cannot run clang regression tests with cmake

Dean Pavlekovic dpavlekovic at gmail.com
Thu May 19 14:15:19 PDT 2011


Hi,

On Thu, May 19, 2011 at 7:30 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:

> arrowdodger <6yearold at gmail.com> writes:
>
> > On Thu, May 19, 2011 at 8:28 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> >
> >> The name liblibclang is forced by an unfortunate collision between MS
> >> and GNU name conventions. We can't create clang.dll with MS since we
> >> already have clang.exe on the same directory (.pdb, .ilk and possibly
> >> other files collide) so we must use some other name for clang.dll, like
> >> libclang.dll. Then this produces liblibclang.so on GNU.
> >>
> >
> > I've wanted to ask earleir, but forgot about it:
> > Why we can't produce libclang.dll on Win and clang.so on Unixies?
>
> For the resason explained on the text you didn't quote. The user would
> need to be aware of the difference and do:
>
> if( MSVC )
>  target_link_libraries(myproject libclang)
> else()
>  target_link_libraries(myproject clang)
> endif()
>
>
FWIW, one could use something like:

if(MSVC)
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
endif()

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.
User would then need to have only target_link_libraries(myproject clang) on
all platforms.
http://www.vtk.org/Wiki/CMake_Useful_Variables#Prefixes.2C_Suffixes_.28Postfixes.29.2C_and_Extensions
(they
say it's read only var there, but apparently works)

Cheers,
Dean




> Of course this is not a reason that makes impossible to do what you
> suggest. I picked a trade-off. If the consensus is that using different
> names is the right thing, it's okay with me. However, I don't accept
> reasonings of the type: "since I only work on Linux I don't care about
> whatever problems Windows users may have." Please keep in mind that for
> MSVC users cmake is the only way of building LLVM/Clang.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110519/4b4f7bce/attachment.html>


More information about the cfe-dev mailing list