[llvm-bugs] [Bug 39530] New: cmake with BUILD_SHARED_LIBS / LLVM_BUILD_LLVM_DYLIB gives an error

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 1 21:32:45 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39530

            Bug ID: 39530
           Summary: cmake with BUILD_SHARED_LIBS / LLVM_BUILD_LLVM_DYLIB
                    gives an error
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: jsshin at sor.snu.ac.kr
                CC: llvm-bugs at lists.llvm.org

Created attachment 21068
  --> https://bugs.llvm.org/attachment.cgi?id=21068&action=edit
cmake error output

cmake -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD="host;ARM"
-DLLVM_PARALLEL_COMPILE_JOBS="6" -DLLVM_PARALLEL_LINK_JOBS="1" 
-DLLVM_OPTIMIZED_TABLEGEN="ON"          -DLLVM_BINUTILS_INCDIR=/usr/include 
-DLLVM_BUILD_LLVM_DYLIB=ON   -GNinja ../llvm

complains as follows:

CMake Error at tools/llvm-shlib/CMakeLists.txt:44 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present. 

Googling the problem, I found that the following solution works.

diff --git a/tools/llvm-shlib/CMakeLists.txt b/tools/llvm-shlib/CMakeLists.txt
index 187066e..23e768c 100644
--- a/tools/llvm-shlib/CMakeLists.txt
+++ b/tools/llvm-shlib/CMakeLists.txt
@@ -41,7 +41,9 @@ if(LLVM_BUILD_LLVM_DYLIB)

   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 "GNU")

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181102/c01b2125/attachment.html>


More information about the llvm-bugs mailing list