-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
80 lines (67 loc) · 1.33 KB
/
meson.build
File metadata and controls
80 lines (67 loc) · 1.33 KB
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
project('devkit', 'cpp',
default_options: {
'buildtype': 'release',
'cpp_std' : 'c++20',
'cpp_args' : '-O3',
'cpp_eh' : 'none',
}
)
if get_option('buildtype') == 'debug'
test_args = [
'-DDEBUG',
'-fsanitize=address',
'-fsanitize=undefined',
'-fno-omit-frame-pointer',
]
else
test_args = []
endif
comp_args = test_args + [
'-DDOCTEST_CONFIG_DISABLE',
]
# ---------
# build
# ---------
deps = [
dependency('fmt'),
dependency('lua'),
]
srcs = [
'./src/args.hh',
'./src/defer.hh',
'./src/fmt.hh',
'./src/lua.hh',
'./src/task.hh',
]
inc_dirs = include_directories('./src')
executable('sk', [
'./app/sk.cpp'
] + srcs,
dependencies: deps,
include_directories: inc_dirs,
cpp_args: comp_args,
link_args: comp_args,
install: true,
)
# ---------
# test
# ---------
python = find_program('python3')
gen = generator(python,
output: '@BASENAME@_test.cpp',
arguments: [ '@SOURCE_DIR@/test/generator.py', '@INPUT@', '@OUTPUT@']
)
test_dep = deps + [ dependency('doctest') ]
foreach file : srcs
name = '@0@_test'.format(
file.split('/')[-1].split('.')[0]
)
exec = executable(name,
gen.process(file),
dependencies: test_dep,
include_directories: inc_dirs,
cpp_args: test_args,
link_args: test_args,
)
test(name, exec)
endforeach