Skip to content

Commit

Permalink
add support for windows platform(msys2)
Browse files Browse the repository at this point in the history
  • Loading branch information
beordle committed May 4, 2022
1 parent 7605ae0 commit 2fe2d21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 2.8)
project(termtunnel C)
set(CMAKE_C_STANDARD 11)

if (CMAKE_HOST_WIN32)
set(WINDOWS 1)
elseif (CMAKE_HOST_APPLE)
Expand All @@ -10,8 +9,10 @@ elseif (CMAKE_HOST_UNIX)
set(LINUX 1)
endif ()

IF (NOT CYGWIN)
add_subdirectory(thirdparty/libuv)
include_directories(thirdparty/libuv/include)
endif()

add_compile_options(-fpermissive -O3)

Expand Down Expand Up @@ -70,7 +71,12 @@ thirdparty/setproctitle.c
thirdparty/tinyfiledialogs/tinyfiledialogs.c
)

IF (CYGWIN) # cygwin use system default libuv without epoll.
target_link_libraries(termtunnel uv)
ELSE()
target_link_libraries(termtunnel uv_a)
ENDIF()

if (LINUX)
target_link_libraries(termtunnel PUBLIC "-static")
endif()
4 changes: 4 additions & 0 deletions src/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ a lot of data that needs to be copied, this should be set high. */
/* MEMP_NUM_NETBUF: the number of struct netbufs. */
#define MEMP_NUM_NETBUF 200000
/* MEMP_NUM_NETCONN: the number of struct netconns. */
#ifdef __CYGWIN__
#define MEMP_NUM_NETCONN 20
#else
#define MEMP_NUM_NETCONN 200 // number of socket
#endif
/* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used
for sequential API communication and incoming packets. Used in
src/api/tcpip.c. */
Expand Down

0 comments on commit 2fe2d21

Please sign in to comment.