From bfddc49f8119d6718a8a11b130381096ae7c0362 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Tue, 24 Apr 2018 18:37:28 -0500
Subject: [PATCH] CMake: Force Multi-threaded DLL runtime

---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd4517c..828fc80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,6 +169,8 @@ IF (MSVC)
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX")
   # /Oi option enables built-in functions.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi")
+  # /MD option for Multi-threaded DLL (non-debug since you cannot mix them).
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MD")
   #################################################################
   # Set compile flags for release build.
   SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi")
@@ -183,6 +185,8 @@ IF (MSVC)
     SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4244")
     SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
   ENDIF (MSVC_VERSION LESS 1900)
+  # /MD option for Multi-threaded DLL.
+  SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
 ENDIF (MSVC)
 
 # Enable CTest/CDash support
-- 
2.15.0

