<div dir="ltr"><div>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.<br><br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 3, 2018 at 6:42 PM, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+ Chris and Sylvestre as possible reviewers.<br>
<br>
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.<br>
<br>
vedant<br>
<div><div class="h5"><br>
> On Jan 3, 2018, at 12:42 PM, Andy Bauer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> Below is a patch for fixing a CMake issue I found:<br>
> diff --git a/tools/llvm-shlib/CMakeLists.<wbr>txt b/tools/llvm-shlib/CMakeLists.<wbr>txt<br>
> index b2109c8..a032540 100644<br>
> --- a/tools/llvm-shlib/CMakeLists.<wbr>txt<br>
> +++ b/tools/llvm-shlib/CMakeLists.<wbr>txt<br>
> @@ -36,7 +36,9 @@ endif()<br>
><br>
>  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})<br>
><br>
> -list(REMOVE_DUPLICATES LIB_NAMES)<br>
> +if(LIB_NAMES)<br>
> +  list(REMOVE_DUPLICATES LIB_NAMES)<br>
> +endif()<br>
>  if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)<br>
>     OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")<br>
>     OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")<br>
><br>
><br>
><br>
> 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<br>
> 668a58d36b428217126511749a575a<wbr>eb83fbc12f.<br>
><br>
> Please let me know if you need more information to properly review this patch.<br>
><br>
> Best,<br>
> Andy<br>
><br>
><br>
</div></div>> <CMakeCache.txt>______________<wbr>______________________________<wbr>___<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote></div><br></div>