[cmake] Need PUBLIC dependencies for object targets even if LLVM_PTHREAD_LIB is unset
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Thu, 14 May 2020 00:17:54 +0000 (17:17 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Thu, 14 May 2020 00:19:32 +0000 (17:19 -0700)
Fix logic in previous patch.

llvm/cmake/modules/AddLLVM.cmake

index 278f3fa..7c568f0 100644 (file)
@@ -483,11 +483,13 @@ function(llvm_add_library name)
         "PUBLIC;PRIVATE"
         ${ARG_LINK_LIBS})
       foreach(link_lib ${LINK_LIBS_ARG_PUBLIC})
-        # Can't specify a dependence on -lpthread
         if(LLVM_PTHREAD_LIB)
+          # Can't specify a dependence on -lpthread
           if(NOT ${link_lib} STREQUAL ${LLVM_PTHREAD_LIB})
             add_dependencies(${obj_name} ${link_lib})
           endif()
+        else()
+          add_dependencies(${obj_name} ${link_libs})
         endif()
       endforeach()
     endif()