[cmake] Check for empty LLVM_PTHREAD_LIB
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Wed, 13 May 2020 23:40:51 +0000 (16:40 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Wed, 13 May 2020 23:42:05 +0000 (16:42 -0700)
Windows builds broke because LLVM_THREAD_LIB is not set.

llvm/cmake/modules/AddLLVM.cmake

index cbbe438..278f3fa 100644 (file)
@@ -484,8 +484,10 @@ function(llvm_add_library name)
         ${ARG_LINK_LIBS})
       foreach(link_lib ${LINK_LIBS_ARG_PUBLIC})
         # Can't specify a dependence on -lpthread
-        if(NOT ${link_lib} STREQUAL ${LLVM_PTHREAD_LIB})
-          add_dependencies(${obj_name} ${link_lib})
+        if(LLVM_PTHREAD_LIB)
+          if(NOT ${link_lib} STREQUAL ${LLVM_PTHREAD_LIB})
+            add_dependencies(${obj_name} ${link_lib})
+          endif()
         endif()
       endforeach()
     endif()