-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
52 lines (45 loc) · 1.22 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
project('ubsh', 'c',
default_options: [
'warning_level=3',
'debug=true',
'b_sanitize=address',
'c_std=c99',
'b_coverage=true',
])
add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
add_project_arguments('-Wno-pedantic', language: 'c')
inc = include_directories(['include'])
src = [
'src/ast/node_value.c',
'src/ast/node_not.c',
'src/prompt.c',
'src/token_recognition.c',
'src/charstream.c',
'src/wordvec.c',
'src/token.c',
'src/lexer.c',
'src/queue.c',
'src/ast/parser.c',
'src/ast/node_list.c',
'src/ast/node_simple_command.c',
'src/command.c',
]
main = [
'src/main.c',
]
readline = dependency('readline')
executable('ubsh', src, main, dependencies: [readline], include_directories: inc)
unit_tests_src = [
'tests/ast.c',
'tests/charstream.c',
'tests/wordvec.c',
'tests/lexer.c',
'tests/queue.c',
]
if get_option('enable_tests')
criterion = dependency('criterion', required: false)
unit_tests = executable('unit_tests', src, unit_tests_src, dependencies: [criterion], include_directories: inc, override_options: ['b_coverage=true'])
test('Unit tests', unit_tests)
else
warning('Tests are disabled. Run ``meson -Denable_tests=true``')
endif