-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
70 lines (54 loc) · 1.16 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
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_module")
project(ip2socks)
set(CMAKE_CXX_STANDARD 11)
set(LIBEVDIR libev)
set(LIBYAML libyaml)
set(LWIPDIR lwip/src)
set(LWIPARCH lwip-contrib/ports/unix/port)
include(cmake/liblwip.cmake)
include(cmake/libyaml.cmake)
include(cmake/libev.cmake)
include_directories(
# lwip and patch
${LWIPDIR}/include
${LWIPARCH}/include
# libev
${LIBEVDIR}
# libyaml
${LIBYAML}/include
${LIBYAML}/win32
${LIBYAML}/src
# source code
src/netif
src/dns
src
)
set(MAIN_SOURCE_FILES
# lwip and patch
${LWIP_SOURCE_FILES}
# libev
${LIBEVDIR}/ev.c
# libyaml
${YAML_SOURCE_FILES}
# patch files
src/netif/tunif.c
src/netif/socket_util.c
src/dns/dns_parser.c
src/struct.cpp
src/socks5.cpp
src/util.cpp
src/tcp_raw.cpp
src/udp_raw.cpp
src/main.cpp
)
# linux
if (UNIX AND NOT APPLE)
set(MAIN_SOURCE_FILES
${MAIN_SOURCE_FILES}
# patch files
src/netif/tapif.c
)
endif ()
add_executable(ip2socks ${MAIN_SOURCE_FILES})
target_link_libraries(ip2socks resolv)