-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
164 lines (132 loc) · 3.42 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
cmake_minimum_required(VERSION 2.8.4)
project(webc)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -m64 -pthread -fpermissive -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -m64 -g -pthread")
set(FSTR
src/common/fstr.h
src/common/fstr.c
src/common/fstr.hpp
)
set(LIST
${FSTR}
src/common/flist.h
src/common/flist.c
src/common/flist.hpp
src/common/fmap.h
src/common/fmap.c
src/common/sortlist.hpp
)
set(FMAP
src/common/fmap.h
src/common/fmap.c
src/common/fmap.hpp
)
set(COMMON
src/common/common.h
src/common/common.c
src/common/flog.h
src/common/flog.c
src/common/fmem.h
src/common/fmem.c
${FSTR}
${LIST}
${FMAP}
src/common/fbit.h
src/common/fbit.c
src/common/fqueue.h
src/common/fqueue.hpp
src/common/fqueue.c
src/common/check.h
src/common/bytes.h
src/common/bytes.cpp
)
set(PROTO
proto/gen.sh
proto/meta.proto
proto/meta.pb.h
proto/meta.pb.cc
proto/heartbeat.proto
proto/heartbeat.pb.h
proto/heartbeat.pb.cc
proto/ArrangerService.proto
proto/ArrangerService.pb.h
proto/ArrangerService.pb.cc
proto/WorkerService.proto
proto/WorkerService.pb.h
proto/WorkerService.pb.cc
)
set(FS
src/fs/file_access.h
)
set(WOKER
${COMMON}
src/rpc/RpcServer.h
src/rpc/RpcServer.cpp
src/rpc/RpcClient.h
src/rpc/RpcClient.cpp
src/rpc/InvokeController.cpp
src/chunkServer.h
src/chunkServer.cpp
src/worker/worker.h
src/worker/worker.cpp
)
set(ARRANGER
${COMMON}
src/rpc/RpcServer.h
src/rpc/RpcServer.cpp
src/arranger.h
src/arranger.cpp
src/ArrangerServer.h
src/ArrangerServer.cpp
src/ArrangerConf.cpp
src/ArrangerConf.h
)
set(CLIENT
${COMMON}
src/client.cpp
)
set(THREADPOOL
src/threadpool.h
src/threadpool.c
src/threadpool.hpp
)
set(FDIS
${COMMON}
src/webc.h
src/webc.c
src/cmd.h
src/cmd.c
src/net.h
src/net.c
src/event.h
src/event.c
src/config.h
src/config.c
src/rpc/rpc.h
${PROTO}
${FS}
)
set(FDIS_INC
.
src
src/deps/src
src/se
)
set(FDIS_LIB
/usr/local/lib/libprotoc.a
/usr/local/lib/libprotobuf.a
)
include_directories(${FDIS_INC})
link_libraries(${MFDIS_LIB})
add_executable(threadpool ${THREADPOOL})
add_executable(arranger ${ARRANGER})
set_target_properties(arranger PROPERTIES COMPILE_FLAGS "-DDEBUG_ARRANGER -DLOG_LEVEL=10")
add_executable(worker ${WOKER})
set_target_properties(worker PROPERTIES COMPILE_FLAGS "-DDEBUG_WORKER -DLOG_LEVEL=10")
add_executable(client ${CLIENT})
add_executable(fdis ${FDIS})
add_executable(fmap_test test/fmap_test.cpp ${FMAP})
set_target_properties(fmap_test PROPERTIES COMPILE_FLAGS "-DDEBUG_FMAP -Wall")
add_executable(list_test test/list_test.cpp ${LIST})
set_target_properties(list_test PROPERTIES COMPILE_FLAGS "-DDEBUG_FLIST -Wall")
add_custom_target(distclean rm CMakeFiles cmake_install.cmake CMakeCache.txt Makefile core)