Fixed MinGW 7.3.0 shared library compile and link issues

added definition WIN32_WINNT=0x600
added missing libraries wsock32 ws2_32 crypt32
pull/21720/head
Uwe Kindler 5 years ago committed by Jan Tattermusch
parent b63cbe423d
commit 56f0dfbb29
  1. 5
      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}</%text> /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}</%text>")
set(CMAKE_CXX_FLAGS "<%text>${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}</%text>")
@ -308,7 +311,7 @@
set(_gRPC_ALLTARGETS_LIBRARIES <%text>${CMAKE_DL_LIBS}</%text> rt m pthread)
endif()
if(WIN32 AND MSVC)
if(WIN32)
set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32)
endif()

Loading…
Cancel
Save