-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
86 lines (65 loc) · 1.71 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
85
86
cmake_minimum_required(VERSION 2.8.12)
project(tunonraw)
if (${CMAKE_VERSION} VERSION_LESS 3.1)
set(CMAKE_C_FLAGS "-std=c99")
else()
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED True)
endif()
macro(list_source_directories srcs)
unset(tmp)
foreach(dir ${ARGN})
aux_source_directory(${dir} tmp)
endforeach()
set(${srcs} ${tmp})
#list(FILTER ${srcs} EXCLUDE REGEX ".*_test\\.c")
endmacro()
if(WIN32)
add_compile_options(/utf-8 -DBPF_MAJOR_VERSION)
include_directories("D:/proj/npcap-sdk-1.13/Include")
link_directories("D:/proj/npcap-sdk-1.13/Lib/x64")
set(LIBPCAP wpcap)
else()
set(LIBPCAP pcap)
endif(WIN32)
#-----------------------------
# include_directories(kernel ssl .)
# list_source_directories(TINYWF_SRCS kernel ssl)
# add_library(kernel ${TINYWF_SRCS})
#-----------------------------
########### tor lib start ###########
list_source_directories(TORSRC tor)
add_library(tor ${TORSRC}
kernel/debug.c
kernel/debug.h
kernel/thrqueue_cs.c
kernel/thrqueue.h
kernel/hbase.c
kernel/rbtree.c
kernel/htime.c
kernel/hsocket.c
)
target_include_directories(tor PUBLIC kernel ssl)
# target_link_libraries(tor PUBLIC kernel)
target_compile_definitions(tor PUBLIC HV_STATICLIB)
########### tor lib end ###########
add_executable(test_udpserver
test_udpserver.c
)
target_link_libraries(test_udpserver tor pthread)
######### test udp client ##########
add_executable(test_udpclient
test_udpclient.c
)
target_link_libraries(test_udpclient tor pthread)
######### test raw client ##########
add_executable(test_tor
test_tor.c
)
target_link_libraries(test_tor tor ${LIBPCAP} pthread)
# -------
add_executable(udp2raw
udp2raw.c
)
target_link_libraries(udp2raw tor ${LIBPCAP} pthread)
#