From 2dd3244017163e4b207cb79519758c15da24a3e8 Mon Sep 17 00:00:00 2001 From: fabianbs96 <52407375+fabianbs96@users.noreply.github.com> Date: Fri, 16 Aug 2019 12:22:00 +0200 Subject: [PATCH] Fix issue with empty LIB_NAMES When LIB_NAMES is empty, cmake reports the following error: "list sub-command REMOVE_DUPLICATES requires list to be present." To fix this, wrap an if around this command. --- llvm/tools/llvm-shlib/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt index 4905ed08157fe..41a9663de4f26 100644 --- a/llvm/tools/llvm-shlib/CMakeLists.txt +++ b/llvm/tools/llvm-shlib/CMakeLists.txt @@ -44,7 +44,9 @@ if(LLVM_BUILD_LLVM_DYLIB) endif() add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${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")