  
  if(LIBSSH2_INCLUDE_DIR)
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index a3c17c452..5b8a3bd24 100644
+index a3c17c452..b68a4270c 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -323,7 +323,7 @@ if(CMAKE_USE_WINSSL)

 
 #libSSH2
 option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON)
@@ -1259,7 +1267,21 @@ if(BUILD_SHARED_LIBS)
 else()
   set(ENABLE_SHARED         "no")
   set(ENABLE_STATIC         "yes")
+  add_definitions(-DNGHTTP2_STATICLIB)
+  set(CompilerFlags
+    CMAKE_CXX_FLAGS

+  foreach(CompilerFlag ${CompilerFlags})
+    string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+  endforeach()
+endif()
+
+
 add_subdirectory(lib)
 
 if(BUILD_CURL_EXE)
@@ -1260,6 +1284,8 @@ else()
   set(ENABLE_SHARED         "no")
   set(ENABLE_STATIC         "yes")
 endif()
+
+
