-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
93 lines (83 loc) · 1.9 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
83
84
85
86
87
88
89
90
91
92
93
# SPDX-License-Identifier: BSD-3-Clause
project(
'libalfheim',
'cpp',
default_options: [
'cpp_std=c++17',
'warning_level=3',
'build.cpp_std=c++17',
'buildtype=debugoptimized',
'strip=true',
'b_ndebug=if-release',
'b_lto=true'
],
subproject_dir: 'deps',
version: '0.0.1',
license: [
'BSD-3-Clause',
],
meson_version: '>=0.59.0',
)
cxx = meson.get_compiler('cpp')
if get_option('cpp_std') not in ['c++17', 'c++20', 'c++23', 'gnu++17', 'gnu++20', 'gnu++23']
error('Unsupported C++ Version @0@, must be c++17/gnu++17 or newer'.format(get_option('cpp_std')))
endif
extended_warnings = [
'-Wdouble-promotion',
'-Wformat=2',
'-Wformat-overflow=2',
'-Wformat-signedness',
'-Wformat-truncation',
'-Wnull-dereference',
'-Wmissing-attributes',
'-Wmissing-braces',
'-Wsequence-point',
'-Wreturn-type',
'-Wunused',
'-Wunused-local-typedefs',
'-Wunused-const-variable=2',
'-Wmaybe-uninitialized',
'-Wunknown-pragmas',
'-Wstrict-aliasing',
'-Wstrict-overflow=3',
'-Wstring-compare',
'-Wstringop-overflow',
'-Warith-conversion',
'-Wvla-parameter',
'-Wduplicated-branches',
'-Wshadow=local',
'-Wunsafe-loop-optimizations',
'-Wbad-function-cast',
'-Wcast-qual',
'-Wcast-align=strict',
'-Wcast-function-type',
'-Wconversion',
'-Wdangling-else',
'-Wsign-conversion',
'-Wfloat-conversion',
'-Wpacked',
'-Wpadded',
'-Wredundant-decls',
'-Winline',
'-Wvla',
'-Wstack-protector',
'-Wunsuffixed-float-constant',
'-Wimplicit-fallthrough',
]
add_project_arguments(
cxx.get_supported_arguments(extended_warnings),
language: 'cpp'
)
zlib = dependency('zlib', required: false, version: '>=1.2.12')
if not zlib.found()
message('Did not find local zlib install, bundling')
zlib_wrap = subproject('zlib', default_options: [])
zlib = zlib_wrap.get_variable('zlib_dep')
endif
subdir('src')
if get_option('build_tests')
subdir('tests')
endif
if get_option('build_examples')
subdir('examples')
endif