diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index e6fc6c034ab..24fa7f0eb96 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -266,6 +266,9 @@ # TODO(jtattermusch): needed to build boringssl with VS2017, revisit later set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619") endif() + if (MINGW) + add_definitions(-D_WIN32_WINNT=0x600) + endif() set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}") @@ -308,7 +311,7 @@ set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS} rt m pthread) endif() - if(WIN32 AND MSVC) + if(WIN32) set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32) endif()