|
@@ -29,7 +29,7 @@ option(WITH_MBEDTLS "with mbedtls library" OFF)
|
|
|
|
|
|
|
|
option(WITH_KCP "compile event/kcp" OFF)
|
|
option(WITH_KCP "compile event/kcp" OFF)
|
|
|
|
|
|
|
|
-if(WIN32)
|
|
|
|
|
|
|
+if(WIN32 OR MINGW)
|
|
|
option(WITH_WEPOLL "compile event/wepoll -> use iocp" ON)
|
|
option(WITH_WEPOLL "compile event/wepoll -> use iocp" ON)
|
|
|
option(ENABLE_WINDUMP "Windows MiniDumpWriteDump" OFF)
|
|
option(ENABLE_WINDUMP "Windows MiniDumpWriteDump" OFF)
|
|
|
option(BUILD_FOR_MT "build for /MT" OFF)
|
|
option(BUILD_FOR_MT "build for /MT" OFF)
|
|
@@ -126,7 +126,7 @@ endif()
|
|
|
if(WITH_CURL)
|
|
if(WITH_CURL)
|
|
|
add_definitions(-DWITH_CURL)
|
|
add_definitions(-DWITH_CURL)
|
|
|
set(LIBS ${LIBS} curl)
|
|
set(LIBS ${LIBS} curl)
|
|
|
- if(WIN32)
|
|
|
|
|
|
|
+ if(WIN32 OR MINGW)
|
|
|
set(LIBS ${LIBS} wldap32 advapi32 crypt32)
|
|
set(LIBS ${LIBS} wldap32 advapi32 crypt32)
|
|
|
endif()
|
|
endif()
|
|
|
endif()
|
|
endif()
|
|
@@ -156,7 +156,7 @@ if(WITH_MBEDTLS)
|
|
|
set(LIBS ${LIBS} mbedtls mbedx509 mbedcrypto)
|
|
set(LIBS ${LIBS} mbedtls mbedx509 mbedcrypto)
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
-if(WIN32)
|
|
|
|
|
|
|
+if(WIN32 OR MINGW)
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x0600)
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x0600)
|
|
|
set(LIBS ${LIBS} secur32 crypt32 winmm iphlpapi ws2_32)
|
|
set(LIBS ${LIBS} secur32 crypt32 winmm iphlpapi ws2_32)
|
|
|
if(ENABLE_WINDUMP)
|
|
if(ENABLE_WINDUMP)
|
|
@@ -167,7 +167,7 @@ endif()
|
|
|
|
|
|
|
|
if(ANDROID)
|
|
if(ANDROID)
|
|
|
set(LIBS ${LIBS} log)
|
|
set(LIBS ${LIBS} log)
|
|
|
-elseif(UNIX)
|
|
|
|
|
|
|
+elseif(UNIX AND NOT MINGW)
|
|
|
set(LIBS ${LIBS} pthread m dl)
|
|
set(LIBS ${LIBS} pthread m dl)
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
|
|
set(LIBS ${LIBS} rt)
|
|
set(LIBS ${LIBS} rt)
|
|
@@ -181,7 +181,7 @@ endif()
|
|
|
# see Makefile
|
|
# see Makefile
|
|
|
set(ALL_SRCDIRS . base ssl event event/kcp util cpputil evpp protocol http http/client http/server mqtt)
|
|
set(ALL_SRCDIRS . base ssl event event/kcp util cpputil evpp protocol http http/client http/server mqtt)
|
|
|
set(CORE_SRCDIRS . base ssl event)
|
|
set(CORE_SRCDIRS . base ssl event)
|
|
|
-if(WIN32)
|
|
|
|
|
|
|
+if(WIN32 OR MINGW)
|
|
|
if(WITH_WEPOLL)
|
|
if(WITH_WEPOLL)
|
|
|
set(CORE_SRCDIRS ${CORE_SRCDIRS} event/wepoll)
|
|
set(CORE_SRCDIRS ${CORE_SRCDIRS} event/wepoll)
|
|
|
endif()
|
|
endif()
|