From 48fa557312a5e220ce14ec9d3845e74ff4613de8 Mon Sep 17 00:00:00 2001 From: Oscar Fuentes <ofv@wanadoo.es> Date: Wed, 6 May 2009 20:42:04 +0000 Subject: [PATCH] CMake: Use pthread library when requested and available. llvm-svn: 71116 --- cmake/modules/AddLLVM.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 13ecc37f7fe..62d9f3195bb 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -34,6 +34,9 @@ macro(add_llvm_executable name) target_link_libraries(${name} imagehlp psapi) elseif( CMAKE_HOST_UNIX ) target_link_libraries(${name} dl) + if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD ) + target_link_libraries(${name} pthread) + endif() endif( MINGW ) endif( MSVC ) endmacro(add_llvm_executable name)