-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
executable file
·98 lines (87 loc) · 3.2 KB
/
meson.build
File metadata and controls
executable file
·98 lines (87 loc) · 3.2 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
###################################################################################
# #
# NAME: meson.build #
# #
# AUTHOR: Michael Brockus. #
# #
# CONTACT: <mailto:michael@squidfarts.com> #
# #
# NOTICES: #
# #
# License: Apache 2.0 :http://www.apache.org/licenses/LICENSE-2.0 #
# #
###################################################################################
project('cpp-exe', 'cpp',
version : '0.1.0',
license : 'Apache-2.0',
meson_version : '>=0.50.0',
default_options :
[
'buildtype=release',
'werror=true',
'optimization=3',
'warning_level=3',
'cpp_std=c++17'
]
)
cc = meson.get_compiler('cpp')
args_for_langs = 'cpp'
##
#
# Meson: Add compiler flags
#
##
if cc.get_id() == 'clang'
add_project_arguments(
cc.get_supported_arguments(
[
'-Wweak-vtables',
'-Wexit-time-destructors',
'-Wglobal-constructors',
'-Wmissing-noreturn'
]
), language: args_for_langs)
endif
if cc.get_argument_syntax() == 'gcc'
add_project_arguments(
cc.get_supported_arguments(
[
'-Wunreachable-code',
'-Wmissing-declarations',
'-Wundef',
'-Wwrite-strings',
'-Wformat',
'-Wformat-nonliteral',
'-Wformat-security',
'-Winit-self',
'-Wmissing-include-dirs',
'-Waddress',
'-Waggregate-return',
'-Wno-multichar',
'-Wno-parentheses',
'-Wno-unused-parameter',
'-Wno-type-limits',
'-Wvla',
'-Wpointer-arith'
]
), language: args_for_langs)
endif
if cc.get_id() == 'msvc'
add_project_arguments(
cc.get_supported_arguments(
[
'/w44265',
'/w44061',
'/w44062',
'/wd4018', # implicit signed/unsigned conversion
'/wd4146', # unary minus on unsigned (beware INT_MIN)
'/wd4244', # lossy type conversion (e.g. double -> int)
'/wd4305', # truncating type conversion (e.g. double -> float)
]
), language: args_for_langs)
endif
unity_dep = dependency('unity', required: get_option('with_tests'), fallback : ['unity', 'unity_dep'])
subdir('src')
install_data(
sources: [ 'code_of_conduct.md', 'contributing.md', 'LICENSE', 'readme.md' ],
install_dir: join_paths(get_option('datadir'), meson.project_name()))