one-off patch for CMake issue

Andy Bauer via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 15:07:40 PST 2018


It wouldn't surprise me -- I just started looking at the LLVM source code
for the first time yesterday and didn't try to find all instances of this
issue. Just found and came up with a fix for this one and thought I'd share
it.

Andy

On Wed, Jan 3, 2018 at 6:42 PM, Vedant Kumar <vsk at apple.com> wrote:

> + Chris and Sylvestre as possible reviewers.
>
> At first glance, it seems like the REMOVE_DUPLICATES operation isn't the
> only one we'd like to skip if LIB_NAMES is empty.
>
> vedant
>
> > On Jan 3, 2018, at 12:42 PM, Andy Bauer via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> >
> > Hi,
> >
> > Below is a patch for fixing a CMake issue I found:
> > diff --git a/tools/llvm-shlib/CMakeLists.txt
> b/tools/llvm-shlib/CMakeLists.txt
> > index b2109c8..a032540 100644
> > --- a/tools/llvm-shlib/CMakeLists.txt
> > +++ b/tools/llvm-shlib/CMakeLists.txt
> > @@ -36,7 +36,9 @@ endif()
> >
> >  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME
> ${SOURCES})
> >
> > -list(REMOVE_DUPLICATES LIB_NAMES)
> > +if(LIB_NAMES)
> > +  list(REMOVE_DUPLICATES LIB_NAMES)
> > +endif()
> >  if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
> >     OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
> >     OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
> >
> >
> >
> > The CMake issue was that if LIB_NAMES is not defined then the list()
> method cannot remove duplicates. I encountered this when I enabled
> BUILD_SHARED_LIBS. Attached is my CMakeCache.txt that I encountered the
> issue with. The git SHA I'm working from is
> > 668a58d36b428217126511749a575aeb83fbc12f.
> >
> > Please let me know if you need more information to properly review this
> patch.
> >
> > Best,
> > Andy
> >
> >
> > <CMakeCache.txt>_______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180104/ab650b8c/attachment.html>


More information about the llvm-commits mailing list