Add MINGW_LIBRARIES to the linker flags

This is essential when building with -nodefaultlibs.

This is similar to what already is done in libcxxabi in SVN r302760.

Differential revision: https://reviews.llvm.org/D37207

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 5786514..24c3067 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -91,6 +91,7 @@
   add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
 endif()
 add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
+add_library_flags_if(MINGW "${MINGW_LIBRARIES}")
 
 # Add the unwinder library.
 if (LIBCXXABI_USE_LLVM_UNWINDER)