-
Notifications
You must be signed in to change notification settings - Fork 17
/
meson.build
59 lines (49 loc) · 1.44 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
project('DSPatcher', 'cpp',
default_options: [
'cpp_std=c++11',
'warning_level=3',
'werror=true'
]
)
# Add formatting
format_first = []
if find_program('clang-format', required: false).found()
if host_machine.system() == 'windows'
format_command = meson.current_source_dir() + '/scripts/clang-format.bat'
else
format_command = ['bash', meson.current_source_dir() + '/scripts/clang-format.sh']
endif
format_first = custom_target(
output: 'formatting',
command: format_command,
build_by_default: true
)
endif
# Add static code analysis
if find_program('cppcheck', required: false).found()
if host_machine.system() == 'windows'
extra_cppcheck_args = ['-D_WIN32']
else
extra_cppcheck_args = []
endif
custom_target(
input: format_first,
output: 'static code analysis',
command: [
'cppcheck',
'--error-exitcode=1',
'--enable=all',
'--inconclusive',
'--inline-suppr',
'--force',
'--quiet',
'--suppress=missingIncludeSystem',
'-i', meson.current_source_dir() + '/build',
'-i', meson.current_source_dir() + '/builddir',
'-i', meson.current_source_dir() + '/DSPatchables',
extra_cppcheck_args,
meson.current_source_dir()
],
build_by_default: true
)
endif