diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -851,6 +851,7 @@ # dependencies, then the dependencies of those dependencies, and so on. get_target_property(new_libs ${target} LINK_LIBRARIES) set(link_libs ${new_libs}) + list(REMOVE_DUPLICATES new_libs) while(NOT "${new_libs}" STREQUAL "") foreach(lib ${new_libs}) if(TARGET ${lib})