-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
82 lines (69 loc) · 1.39 KB
/
meson.build
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
project('set-c', 'c',
meson_version: '>=0.49.0',
license: 'MIT',
default_options: [
'optimization=3',
'-march=native'
],
version : '1.0.0')
add_project_arguments([
'-pedantic',
'-Wundef',
'-Wconversion',
'-Wshadow',
'-Wlogical-op',
'-Winit-self',
'-Wstrict-prototypes',
'-Wendif-labels',
'-Woverflow',
'-Wno-missing-braces',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
], language: 'c')
# validate memory issues
add_test_setup('valgrind',
exe_wrapper : ['valgrind', '--error-exitcode=1', '--leak-check=full', '--track-origins=yes', '--exit-on-first-error=yes'],
is_default : false)
# generate flamegraphs w/perf
add_test_setup('perf',
exe_wrapper : ['../benchmark/perf.sh'],
is_default : false)
lib = files([
'src/set.c',
'src/util.c'
])
tests = [
'example',
'member',
'init',
'add',
'length_delete',
'adt1',
'adt2',
'adt3',
'set-ops',
]
benchmarks = [
'perf_0',
'perf_1'
]
inc = include_directories('src')
install_headers('src/set.h')
lib = library('setc',
lib,
include_directories : inc,
install : true)
foreach t : tests
exe = executable(t,
'test/' + t + '.c',
include_directories : inc,
link_with : lib)
test(t, exe)
endforeach
foreach b : benchmarks
exe = executable(b,
'benchmark/' + b +'.c',
include_directories : inc,
link_with : lib)
benchmark(b, exe)
endforeach