aboutsummaryrefslogtreecommitdiffstats
path: root/util/CMakeLists.txt
blob: e61a0c6777b83ae8878042eba1741edf4775fed0 (plain) (blame)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
add_library(yutil)
target_link_libraries(yutil PUBLIC
  contrib-libs-cxxsupp
  util-charset
  contrib-libs-double-conversion
  contrib-libs-libc_compat
)
target_sources(yutil PRIVATE
  ${CMAKE_SOURCE_DIR}/util/system/compiler.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/city.cpp
  ${CMAKE_SOURCE_DIR}/util/random/random.cpp
  ${CMAKE_SOURCE_DIR}/util/string/cast.cpp
  ${CMAKE_SOURCE_DIR}/util/system/valgrind.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mktemp_system.cpp
)
set_property(
  SOURCE
  ${CMAKE_SOURCE_DIR}/util/system/compiler.cpp
  APPEND
  PROPERTY
  COMPILE_OPTIONS
  -fno-lto
)
target_joined_source(yutil
  all_datetime.cpp
  ${CMAKE_SOURCE_DIR}/util/datetime/base.cpp
  ${CMAKE_SOURCE_DIR}/util/datetime/constants.cpp
  ${CMAKE_SOURCE_DIR}/util/datetime/cputimer.cpp
  ${CMAKE_SOURCE_DIR}/util/datetime/systime.cpp
  ${CMAKE_SOURCE_DIR}/util/datetime/uptime.cpp
)
target_joined_source(yutil
  all_digest.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/fnv.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/multi.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/murmur.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/numeric.cpp
  ${CMAKE_SOURCE_DIR}/util/digest/sequence.cpp
)
target_joined_source(yutil
  all_util.cpp
  ${CMAKE_SOURCE_DIR}/util/ysafeptr.cpp
  ${CMAKE_SOURCE_DIR}/util/ysaveload.cpp
  ${CMAKE_SOURCE_DIR}/util/str_stl.cpp
)
target_joined_source(yutil
  all_folder.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/dirut.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/filelist.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/fts.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/fwd.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/iterator.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/path.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/pathsplit.cpp
  ${CMAKE_SOURCE_DIR}/util/folder/tempdir.cpp
)
target_joined_source(yutil
  all_generic.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/scope.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/adaptor.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/algorithm.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/array_ref.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/array_size.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/bitmap.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/bitops.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/bt_exception.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/buffer.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/cast.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/deque.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/explicit_type.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/fastqueue.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/flags.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/function.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/fwd.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/guid.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/hash.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/hash_primes.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/hash_set.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/hide_ptr.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/intrlist.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/is_in.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/iterator.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/iterator_range.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/lazy_value.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/list.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/map.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/mapfindptr.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/maybe.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/mem_copy.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/noncopyable.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/object_counter.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/overloaded.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/ptr.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/queue.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/refcount.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/serialized_enum.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/set.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/singleton.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/size_literals.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/stack.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/store_policy.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/strbuf.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/strfcpy.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/string.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/typelist.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/typetraits.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/utility.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/va_args.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/vector.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/xrange.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/yexception.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/ylimits.cpp
  ${CMAKE_SOURCE_DIR}/util/generic/ymath.cpp
)
target_joined_source(yutil
  all_memory.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/addstorage.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/alloc.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/blob.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/mmapalloc.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/pool.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/segmented_string_pool.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/segpool_alloc.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/smallobj.cpp
  ${CMAKE_SOURCE_DIR}/util/memory/tempbuf.cpp
)
target_joined_source(yutil
  all_network.cpp
  ${CMAKE_SOURCE_DIR}/util/network/address.cpp
  ${CMAKE_SOURCE_DIR}/util/network/endpoint.cpp
  ${CMAKE_SOURCE_DIR}/util/network/hostip.cpp
  ${CMAKE_SOURCE_DIR}/util/network/init.cpp
  ${CMAKE_SOURCE_DIR}/util/network/interface.cpp
  ${CMAKE_SOURCE_DIR}/util/network/iovec.cpp
  ${CMAKE_SOURCE_DIR}/util/network/ip.cpp
  ${CMAKE_SOURCE_DIR}/util/network/nonblock.cpp
  ${CMAKE_SOURCE_DIR}/util/network/pair.cpp
  ${CMAKE_SOURCE_DIR}/util/network/poller.cpp
  ${CMAKE_SOURCE_DIR}/util/network/pollerimpl.cpp
  ${CMAKE_SOURCE_DIR}/util/network/sock.cpp
  ${CMAKE_SOURCE_DIR}/util/network/socket.cpp
)
target_joined_source(yutil
  all_random.cpp
  ${CMAKE_SOURCE_DIR}/util/random/common_ops.cpp
  ${CMAKE_SOURCE_DIR}/util/random/easy.cpp
  ${CMAKE_SOURCE_DIR}/util/random/entropy.cpp
  ${CMAKE_SOURCE_DIR}/util/random/fast.cpp
  ${CMAKE_SOURCE_DIR}/util/random/lcg_engine.cpp
  ${CMAKE_SOURCE_DIR}/util/random/mersenne32.cpp
  ${CMAKE_SOURCE_DIR}/util/random/mersenne64.cpp
  ${CMAKE_SOURCE_DIR}/util/random/mersenne.cpp
  ${CMAKE_SOURCE_DIR}/util/random/normal.cpp
  ${CMAKE_SOURCE_DIR}/util/random/shuffle.cpp
  ${CMAKE_SOURCE_DIR}/util/random/init_atfork.cpp
)
target_joined_source(yutil
  all_stream.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/aligned.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/buffer.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/buffered.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/debug.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/direct_io.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/file.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/format.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/fwd.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/hex.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/holder.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/input.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/labeled.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/length.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/mem.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/multi.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/null.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/output.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/pipe.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/printf.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/str.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/tee.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/tempbuf.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/tokenizer.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/trace.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/walk.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/zerocopy.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/zerocopy_output.cpp
  ${CMAKE_SOURCE_DIR}/util/stream/zlib.cpp
)
target_joined_source(yutil
  all_string.cpp
  ${CMAKE_SOURCE_DIR}/util/string/ascii.cpp
  ${CMAKE_SOURCE_DIR}/util/string/builder.cpp
  ${CMAKE_SOURCE_DIR}/util/string/cstriter.cpp
  ${CMAKE_SOURCE_DIR}/util/string/escape.cpp
  ${CMAKE_SOURCE_DIR}/util/string/hex.cpp
  ${CMAKE_SOURCE_DIR}/util/string/join.cpp
  ${CMAKE_SOURCE_DIR}/util/string/printf.cpp
  ${CMAKE_SOURCE_DIR}/util/string/reverse.cpp
  ${CMAKE_SOURCE_DIR}/util/string/split.cpp
  ${CMAKE_SOURCE_DIR}/util/string/strip.cpp
  ${CMAKE_SOURCE_DIR}/util/string/strspn.cpp
  ${CMAKE_SOURCE_DIR}/util/string/subst.cpp
  ${CMAKE_SOURCE_DIR}/util/string/type.cpp
  ${CMAKE_SOURCE_DIR}/util/string/util.cpp
  ${CMAKE_SOURCE_DIR}/util/string/vector.cpp
)
target_joined_source(yutil
  all_system_1.cpp
  ${CMAKE_SOURCE_DIR}/util/system/atexit.cpp
  ${CMAKE_SOURCE_DIR}/util/system/backtrace.cpp
  ${CMAKE_SOURCE_DIR}/util/system/compat.cpp
  ${CMAKE_SOURCE_DIR}/util/system/condvar.cpp
  ${CMAKE_SOURCE_DIR}/util/system/context.cpp
  ${CMAKE_SOURCE_DIR}/util/system/daemon.cpp
  ${CMAKE_SOURCE_DIR}/util/system/datetime.cpp
  ${CMAKE_SOURCE_DIR}/util/system/defaults.c
  ${CMAKE_SOURCE_DIR}/util/system/direct_io.cpp
  ${CMAKE_SOURCE_DIR}/util/system/dynlib.cpp
  ${CMAKE_SOURCE_DIR}/util/system/env.cpp
  ${CMAKE_SOURCE_DIR}/util/system/error.cpp
  ${CMAKE_SOURCE_DIR}/util/system/event.cpp
  ${CMAKE_SOURCE_DIR}/util/system/execpath.cpp
  ${CMAKE_SOURCE_DIR}/util/system/fasttime.cpp
  ${CMAKE_SOURCE_DIR}/util/system/file.cpp
  ${CMAKE_SOURCE_DIR}/util/system/file_lock.cpp
  ${CMAKE_SOURCE_DIR}/util/system/filemap.cpp
  ${CMAKE_SOURCE_DIR}/util/system/flock.cpp
  ${CMAKE_SOURCE_DIR}/util/system/fs.cpp
  ${CMAKE_SOURCE_DIR}/util/system/fstat.cpp
  ${CMAKE_SOURCE_DIR}/util/system/getpid.cpp
  ${CMAKE_SOURCE_DIR}/util/system/hi_lo.cpp
  ${CMAKE_SOURCE_DIR}/util/system/hostname.cpp
  ${CMAKE_SOURCE_DIR}/util/system/hp_timer.cpp
  ${CMAKE_SOURCE_DIR}/util/system/info.cpp
)
target_joined_source(yutil
  all_system_2.cpp
  ${CMAKE_SOURCE_DIR}/util/system/align.cpp
  ${CMAKE_SOURCE_DIR}/util/system/atomic.cpp
  ${CMAKE_SOURCE_DIR}/util/system/byteorder.cpp
  ${CMAKE_SOURCE_DIR}/util/system/cpu_id.cpp
  ${CMAKE_SOURCE_DIR}/util/system/fhandle.cpp
  ${CMAKE_SOURCE_DIR}/util/system/guard.cpp
  ${CMAKE_SOURCE_DIR}/util/system/interrupt_signals.cpp
  ${CMAKE_SOURCE_DIR}/util/system/madvise.cpp
  ${CMAKE_SOURCE_DIR}/util/system/maxlen.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mem_info.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mincore.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mktemp.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mlock.cpp
  ${CMAKE_SOURCE_DIR}/util/system/mutex.cpp
  ${CMAKE_SOURCE_DIR}/util/system/nice.cpp
  ${CMAKE_SOURCE_DIR}/util/system/pipe.cpp
  ${CMAKE_SOURCE_DIR}/util/system/platform.cpp
  ${CMAKE_SOURCE_DIR}/util/system/progname.cpp
  ${CMAKE_SOURCE_DIR}/util/system/protect.cpp
  ${CMAKE_SOURCE_DIR}/util/system/rusage.cpp
  ${CMAKE_SOURCE_DIR}/util/system/rwlock.cpp
  ${CMAKE_SOURCE_DIR}/util/system/sanitizers.cpp
  ${CMAKE_SOURCE_DIR}/util/system/sem.cpp
  ${CMAKE_SOURCE_DIR}/util/system/shellcommand.cpp
  ${CMAKE_SOURCE_DIR}/util/system/shmat.cpp
  ${CMAKE_SOURCE_DIR}/util/system/sigset.cpp
  ${CMAKE_SOURCE_DIR}/util/system/spinlock.cpp
  ${CMAKE_SOURCE_DIR}/util/system/spin_wait.cpp
  ${CMAKE_SOURCE_DIR}/util/system/src_location.cpp
  ${CMAKE_SOURCE_DIR}/util/system/sys_alloc.cpp
  ${CMAKE_SOURCE_DIR}/util/system/sysstat.cpp
  ${CMAKE_SOURCE_DIR}/util/system/tempfile.cpp
  ${CMAKE_SOURCE_DIR}/util/system/thread.cpp
  ${CMAKE_SOURCE_DIR}/util/system/tls.cpp
  ${CMAKE_SOURCE_DIR}/util/system/types.cpp
  ${CMAKE_SOURCE_DIR}/util/system/type_name.cpp
  ${CMAKE_SOURCE_DIR}/util/system/unaligned_mem.cpp
  ${CMAKE_SOURCE_DIR}/util/system/user.cpp
  ${CMAKE_SOURCE_DIR}/util/system/utime.cpp
  ${CMAKE_SOURCE_DIR}/util/system/yassert.cpp
  ${CMAKE_SOURCE_DIR}/util/system/yield.cpp
)
target_joined_source(yutil
  all_thread.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/factory.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/fwd.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/lfqueue.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/lfstack.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/pool.cpp
  ${CMAKE_SOURCE_DIR}/util/thread/singleton.cpp
)
target_ragel_lexers(yutil
  PRIVATE
  ${CMAKE_SOURCE_DIR}/util/datetime/parser.rl6
  -CG2
)
target_yasm_source(yutil
  PRIVATE
  ${CMAKE_SOURCE_DIR}/util/system/context_x86.asm
  -I
  ${CMAKE_BINARY_DIR}
  -I
  ${CMAKE_SOURCE_DIR}
)