-
Notifications
You must be signed in to change notification settings - Fork 35
/
CMakeLists.txt
85 lines (78 loc) · 2.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 2.8)
project(termtunnel C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 11)
if (CMAKE_HOST_WIN32)
set(WINDOWS 1)
elseif (CMAKE_HOST_APPLE)
set(MACOS 1)
elseif (CMAKE_HOST_UNIX)
set(LINUX 1)
endif ()
IF (NOT CYGWIN)
add_subdirectory(thirdparty/libuv)
include_directories(thirdparty/libuv/include)
endif()
add_compile_options(-Os)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/lwip/include)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/port/include)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR})
add_executable(termtunnel
src/entry.c
src/utils.c
src/pty.c
src/agent.c
src/log.c
src/pipe.c
src/repl.c
src/fsm.c
src/vnet.c
src/state.c
src/fileexchange.c
src/socksproxy.c
src/agentcall.c
src/portforward.c
thirdparty/lwip/core/ip.c
thirdparty/lwip/core/init.c
thirdparty/lwip/core/def.c
thirdparty/lwip/core/inet_chksum.c
thirdparty/lwip/core/mem.c
thirdparty/lwip/core/memp.c
thirdparty/lwip/core/netif.c
thirdparty/lwip/core/pbuf.c
thirdparty/lwip/core/stats.c
thirdparty/lwip/core/tcp.c
thirdparty/lwip/core/tcp_in.c
thirdparty/lwip/core/tcp_out.c
thirdparty/lwip/core/timeouts.c
thirdparty/lwip/core/ipv4/etharp.c
thirdparty/lwip/core/ipv4/icmp.c
thirdparty/lwip/core/ipv4/ip4_frag.c
thirdparty/lwip/core/ipv4/ip4.c
thirdparty/lwip/core/ipv4/ip4_addr.c
thirdparty/lwip/api/api_lib.c
thirdparty/lwip/api/api_msg.c
thirdparty/lwip/api/err.c
thirdparty/lwip/api/netbuf.c
thirdparty/lwip/api/sockets.c
thirdparty/lwip/api/tcpip.c
thirdparty/lwip/netif/ethernet.c
thirdparty/port/sys_arch.c
#thirdparty/port/perf.c
thirdparty/base64.c
thirdparty/linenoise.c
thirdparty/queue/queue.c
thirdparty/queue/queue_internal.c
thirdparty/setproctitle.c
thirdparty/tinyfiledialogs/tinyfiledialogs.c
thirdparty/ya_getopt/ya_getopt.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()