aboutsummaryrefslogtreecommitdiffstats
path: root/util/ya.make
blob: 5b36bf9df905aa289ea02eb4608700842af9a11f (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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
LIBRARY(yutil) 
 
OWNER(g:util)
SUBSCRIBER(g:util-subscribers)
 
NEED_CHECK()

NO_UTIL()

# stream
# string
PEERDIR(
    util/charset
    contrib/libs/zlib
    contrib/libs/double-conversion
)
 
PEERDIR(
    contrib/libs/libc_compat
)

# datetime 
JOIN_SRCS( 
    all_datetime.cpp 
    datetime/base.cpp 
    datetime/constants.cpp
    datetime/cputimer.cpp 
    datetime/systime.cpp 
    datetime/uptime.cpp
) 
 
SRCS( 
    datetime/parser.rl6 
    digest/city.cpp
    random/random.cpp
    string/cast.cpp
) 
 
IF (OS_WINDOWS)
    SRCS( 
        datetime/strptime.cpp 
    ) 
ENDIF() 
 
# digest 
JOIN_SRCS( 
    all_digest.cpp 
    digest/fnv.cpp
    digest/multi.cpp
    digest/murmur.cpp 
    digest/numeric.cpp 
    digest/sequence.cpp
) 
 
JOIN_SRCS( 
    all_util.cpp 
    ysafeptr.cpp
    ysaveload.cpp
    str_stl.cpp 
)

# folder 
JOIN_SRCS( 
    all_folder.cpp 
    folder/dirut.cpp
    folder/filelist.cpp
    folder/fts.cpp 
    folder/fwd.cpp
    folder/iterator.cpp
    folder/path.cpp 
    folder/pathsplit.cpp 
    folder/tempdir.cpp 
) 
 
IF (OS_WINDOWS)
    SRCS( 
        folder/lstat_win.c 
        folder/dirent_win.c 
    ) 
ENDIF() 
 
# generic 
JOIN_SRCS( 
    all_generic.cpp 
    generic/scope.cpp 
    generic/adaptor.cpp 
    generic/algorithm.cpp
    generic/array_ref.cpp
    generic/array_size.cpp 
    generic/bitmap.cpp 
    generic/bitops.cpp 
    generic/bt_exception.cpp 
    generic/buffer.cpp
    generic/cast.cpp 
    generic/deque.cpp 
    generic/explicit_type.cpp
    generic/fastqueue.cpp 
    generic/flags.cpp
    generic/function.cpp
    generic/fwd.cpp 
    generic/guid.cpp
    generic/hash.cpp
    generic/hash_primes.cpp
    generic/hash_set.cpp 
    generic/hide_ptr.cpp
    generic/intrlist.cpp 
    generic/is_in.cpp 
    generic/iterator.cpp 
    generic/iterator_range.cpp
    generic/lazy_value.cpp 
    generic/list.cpp 
    generic/map.cpp 
    generic/mapfindptr.cpp 
    generic/maybe.cpp 
    generic/mem_copy.cpp
    generic/noncopyable.cpp 
    generic/object_counter.cpp
    generic/overloaded.cpp
    generic/ptr.cpp
    generic/queue.cpp 
    generic/refcount.cpp 
    generic/serialized_enum.cpp
    generic/set.cpp 
    generic/singleton.cpp
    generic/size_literals.cpp
    generic/stack.cpp 
    generic/store_policy.cpp 
    generic/strbuf.cpp
    generic/strfcpy.cpp
    generic/string.cpp
    generic/typelist.cpp
    generic/typetraits.cpp 
    generic/utility.cpp
    generic/va_args.cpp
    generic/vector.cpp 
    generic/xrange.cpp
    generic/yexception.cpp
    generic/ylimits.cpp 
    generic/ymath.cpp
) 
 
# memory 
JOIN_SRCS( 
    all_memory.cpp 
    memory/addstorage.cpp
    memory/alloc.cpp
    memory/blob.cpp 
    memory/mmapalloc.cpp 
    memory/pool.cpp 
    memory/segmented_string_pool.cpp 
    memory/segpool_alloc.cpp 
    memory/smallobj.cpp 
    memory/tempbuf.cpp
) 
 
# network 
JOIN_SRCS( 
    all_network.cpp 
    network/address.cpp
    network/endpoint.cpp
    network/hostip.cpp 
    network/init.cpp 
    network/interface.cpp 
    network/iovec.cpp 
    network/ip.cpp 
    network/nonblock.cpp
    network/pair.cpp
    network/poller.cpp
    network/pollerimpl.cpp 
    network/sock.cpp 
    network/socket.cpp
) 
 
# random 
JOIN_SRCS( 
    all_random.cpp 
    random/common_ops.cpp 
    random/easy.cpp 
    random/entropy.cpp
    random/fast.cpp 
    random/lcg_engine.cpp 
    random/mersenne32.cpp 
    random/mersenne64.cpp 
    random/mersenne.cpp
    random/normal.cpp 
    random/shuffle.cpp 
    random/init_atfork.cpp 
) 
 
JOIN_SRCS( 
    all_stream.cpp 
    stream/aligned.cpp
    stream/buffer.cpp 
    stream/buffered.cpp 
    stream/debug.cpp 
    stream/direct_io.cpp 
    stream/file.cpp 
    stream/format.cpp
    stream/fwd.cpp
    stream/hex.cpp 
    stream/holder.cpp
    stream/input.cpp 
    stream/labeled.cpp
    stream/length.cpp 
    stream/mem.cpp 
    stream/multi.cpp 
    stream/null.cpp 
    stream/output.cpp 
    stream/pipe.cpp 
    stream/printf.cpp
    stream/str.cpp 
    stream/tee.cpp 
    stream/tempbuf.cpp 
    stream/tokenizer.cpp 
    stream/trace.cpp 
    stream/walk.cpp
    stream/zerocopy.cpp
    stream/zerocopy_output.cpp
    stream/zlib.cpp
) 
 
JOIN_SRCS( 
    all_string.cpp 
    string/ascii.cpp
    string/builder.cpp 
    string/cstriter.cpp
    string/escape.cpp 
    string/hex.cpp 
    string/join.cpp 
    string/printf.cpp
    string/reverse.cpp
    string/split.cpp
    string/strip.cpp
    string/strspn.cpp 
    string/subst.cpp 
    string/type.cpp
    string/util.cpp
    string/vector.cpp
) 
 
IF (ARCH_ARM) 
    CFLAGS(-D_FORTIFY_SOURCE=0) 
ENDIF() 
 
IF (TSTRING_IS_STD_STRING)
    CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING)
ENDIF()

JOIN_SRCS( 
    all_system_1.cpp 
    system/atexit.cpp 
    system/backtrace.cpp 
    system/compat.cpp 
    system/condvar.cpp 
    system/context.cpp 
    system/daemon.cpp 
    system/datetime.cpp 
    system/defaults.c 
    system/direct_io.cpp 
    system/dynlib.cpp 
    system/env.cpp 
    system/error.cpp 
    system/event.cpp 
    system/execpath.cpp 
    system/fasttime.cpp 
    system/file.cpp 
    system/file_lock.cpp
    system/filemap.cpp 
    system/flock.cpp 
    system/fs.cpp 
    system/fstat.cpp 
    system/getpid.cpp 
    system/hi_lo.cpp
    system/hostname.cpp 
    system/hp_timer.cpp 
    system/info.cpp 
) 
 
IF (OS_WINDOWS) 
    SRCS(system/err.cpp) 
ENDIF() 
 
JOIN_SRCS( 
    all_system_2.cpp 
    system/align.cpp
    system/atomic.cpp
    system/byteorder.cpp
    system/cpu_id.cpp
    system/fhandle.cpp
    system/guard.cpp
    system/interrupt_signals.cpp
    system/madvise.cpp 
    system/maxlen.cpp
    system/mem_info.cpp 
    system/mincore.cpp
    system/mktemp.cpp 
    system/mlock.cpp 
    system/mutex.cpp 
    system/nice.cpp 
    system/pipe.cpp 
    system/platform.cpp 
    system/progname.cpp 
    system/protect.cpp 
    system/rusage.cpp 
    system/rwlock.cpp 
    system/sanitizers.cpp
    system/sem.cpp 
    system/shellcommand.cpp
    system/shmat.cpp
    system/sigset.cpp
    system/spinlock.cpp
    system/spin_wait.cpp 
    system/src_location.cpp
    system/sys_alloc.cpp
    system/sysstat.cpp 
    system/tempfile.cpp 
    system/thread.cpp 
    system/tls.cpp 
    system/types.cpp 
    system/type_name.cpp
    system/unaligned_mem.cpp
    system/user.cpp 
    system/utime.cpp
    system/yassert.cpp 
    system/yield.cpp 
) 
 
SRC(system/compiler.cpp -fno-lto)

IF (OS_WINDOWS)
    SRCS( 
        system/fs_win.cpp 
        system/winint.cpp 
    ) 
ELSEIF (OS_CYGWIN OR OS_IOS)
    # no asm context switching on cygwin or iOS
ELSE() 
    IF (ARCH_X86_64 OR ARCH_I386) 
        SRCS( 
            system/context_x86.asm 
        ) 
    ENDIF() 
    IF (ARCH_AARCH64 OR ARCH_ARM64)
        SRCS( 
            system/context_aarch64.S 
        ) 
    ENDIF() 
ENDIF() 
 
IF (OS_LINUX)
    SRCS( 
        system/valgrind.cpp 
    ) 
    EXTRALIBS( 
        -lrt 
        -ldl 
    ) 
ENDIF() 
 
IF (MUSL) 
    PEERDIR( 
        contrib/libs/linuxvdso 
    ) 
ELSE() 
    IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS)
        SRCS( 
            system/mktemp_system.cpp
        ) 
    ENDIF() 
ENDIF() 
 
# thread 
JOIN_SRCS( 
    all_thread.cpp 
    thread/factory.cpp
    thread/fwd.cpp
    thread/lfqueue.cpp
    thread/lfstack.cpp
    thread/pool.cpp
    thread/singleton.cpp 
) 
 
END() 

RECURSE_FOR_TESTS(
    tests/ut
)