-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmeson.build
83 lines (63 loc) · 1.91 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
project('lockfree', 'c')
##################################
## Common flags
flags_c = [
'-std=c11',
#'-fvisibility=hidden',
]
flags_cpp = [
'-std=c++14',
'-fno-exceptions', '-fno-rtti',
#'-fvisibility=hidden', '-fvisibility-inlines-hidden',
]
flags_common = [
'-fdiagnostics-color=always',
'-D_GNU_SOURCE',
'-Dtypeof=__typeof__',
'-I' + meson.source_root() + '/src',
'-g', '-fPIC',
'-ffast-math', '-fno-associative-math', '-fno-reciprocal-math',
'-fno-strict-aliasing',
]
flags_warn = [
## Warning enables
'-Wall', '-Werror', '-Wextra',
## Warning disables: annoying
'-Wno-unused-function', '-Wno-unused-parameter',
## Warning disables: Complains about 'Type t[1] = {{0}}'
'-Wno-missing-field-initializers',
## Warning disables: Complains about 'if (val < 0 || val >= LIMIT)' when val is unsigned
'-Wno-type-limits',
## Warning disables: Complains about macros that expand to empty if-else bodies
'-Wno-empty-body',
]
flags_release = [
## Optimization
'-O2',
## Warning disables:
'-Wno-unused-variable', '-Wno-unused-but-set-variable',
## Warning disables: Seriously, no comments in comments?
'-Wno-comments',
]
flags_debug = [
]
flags_special = [
]
link_flags_common = [
'-fdiagnostics-color=always',
#'-fvisibility=hidden', '-fvisibility-inlines-hidden',
'-lpthread',
]
add_global_arguments(flags_c + flags_common + flags_warn + flags_special, language : 'c')
add_global_arguments(flags_cpp + flags_common + flags_warn + flags_special, language : 'cpp')
add_global_link_arguments(link_flags_common, language : 'c')
add_global_link_arguments(link_flags_common, language : 'cpp')
## Release
add_global_arguments(flags_release, language : 'c')
add_global_arguments(flags_release, language : 'cpp')
## Debug
# add_global_arguments(flags_debug, language : 'c')
# add_global_arguments(flags_debug, language : 'cpp')
##################################
## Definitions
subdir('src')