Skip to content

Commit b13b6b0

Browse files
committed
meson.build: Borrow CFLAGs from cdba
1 parent 761552a commit b13b6b0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

meson.build

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,34 @@ project('debugcc',
99
]
1010
)
1111

12+
# Set advanced compiler flags
13+
compiler = meson.get_compiler('c')
14+
15+
compiler_cflags = ['-Wno-unused-parameter',
16+
'-Wno-unused-result',
17+
'-Wno-missing-field-initializers',
18+
'-Wno-sign-compare',
19+
'-Wundef',
20+
'-Wnull-dereference',
21+
'-Wdouble-promotion',
22+
'-Wshadow',
23+
'-Wpointer-arith',
24+
'-Wwrite-strings',
25+
'-Wstrict-overflow=4']
26+
27+
# TODO add clang specific options
28+
if compiler.get_id() == 'gcc'
29+
compiler_cflags += ['-Wformat-signedness',
30+
'-Wduplicated-cond',
31+
'-Wduplicated-branches',
32+
'-Wvla-larger-than=1',
33+
'-Walloc-zero',
34+
'-Wunsafe-loop-optimizations',
35+
'-Wcast-align',
36+
'-Wlogical-op',
37+
'-Wjump-misses-init']
38+
endif
39+
1240
platforms = [
1341
'ipq8064',
1442
'msm8936',

0 commit comments

Comments
 (0)