diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 6b10e2c4cd54..cf8f29975e42 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -483,7 +483,8 @@ function(llvm_add_library name) "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 "-.*") add_dependencies(${obj_name} ${link_lib}) endif() endforeach()