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 @@ -483,7 +483,8 @@ "PUBLIC;PRIVATE" ${ARG_LINK_LIBS}) foreach(link_lib ${LINK_LIBS_ARG_PUBLIC}) - if(TARGET ${link_lib}) + # Can't specify a dependence on -lpthread + if(NOT ${link_lib} MATCHES "-l.*") add_dependencies(${obj_name} ${link_lib}) endif() endforeach()