From 9102055df75457e1194008ce6152221112a785ad Mon Sep 17 00:00:00 2001
From: Mateusz Mikula <mati865@gmail.com>
Date: Tue, 14 Mar 2017 17:50:29 +0100
Subject: [PATCH 5/5] add pthread as system lib for mingw

---
 lib/Support/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index 0a8e3897cce..de9cda5dda3 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -41,6 +41,9 @@ set(system_libs)
   # libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
   # advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
   # ntdll required for RtlGetLastNtStatus in lib/Support/ErrorHandling.cpp.
   set(system_libs ${system_libs} psapi shell32 ole32 uuid advapi32 ws2_32 ntdll)
+  if( MINGW )
+    set(system_libs ${system_libs} pthread)
+  endif()
 elseif( CMAKE_HOST_UNIX )
   if( HAVE_LIBRT )
     set(system_libs ${system_libs} rt)
-- 
2.13.3

