Codebase list devhelp / 3d07778
build: do not try to mimic AX_COMPILER_FLAGS It's easier to use the warning_level. It's not equivalent, but it's good enough and it simplifies a lot the meson.build file, and is what is recommended to do. There was a Meson warning: WARNING: Consider using the builtin warning_level option instead of adding warning flags by hand. I've tried warning_level=3 first, but it gives warnings of the following types: - [-Wpedantic] (some of them are easy to fix and it would be nice to fix them). - [-Woverlength-strings] in dh-resources.c. Sébastien Wilmet 4 years ago
1 changed file(s) with 3 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
55 project(
66 'devhelp', 'c',
77 meson_version : '>= 0.47',
8 version : '3.34.0'
8 version : '3.34.0',
9 default_options : ['warning_level=2']
910 )
1011
1112 GNOME = import('gnome')
9899 language : 'c'
99100 )
100101
101 #####
102 # CFLAGS
103 # (This is one of the ugly parts of Meson, currently.)
104 # The same as the AX_COMPILER_FLAGS Autotools macro.
105
102 # Additional CFLAGS.
106103 warning_cflags = [
107 '-fno-strict-aliasing',
108 '-Wall',
109 '-Wextra',
110 '-Wundef',
111 '-Wnested-externs',
112 '-Wwrite-strings',
113 '-Wpointer-arith',
114 '-Wmissing-declarations',
115 '-Wmissing-prototypes',
116 '-Wstrict-prototypes',
117 '-Wredundant-decls',
118104 '-Wno-unused-parameter',
119105 '-Wno-missing-field-initializers',
120 '-Wdeclaration-after-statement',
121 '-Wformat=2',
122 '-Wold-style-definition',
123 '-Wcast-align',
124 '-Wformat-nonliteral',
125 '-Wformat-security',
126 '-Wsign-compare',
127 '-Wstrict-aliasing',
128 '-Wshadow',
129 '-Winline',
130 '-Wpacked',
131 '-Wmissing-format-attribute',
132 '-Wmissing-noreturn',
133 '-Winit-self',
134 '-Wredundant-decls',
135 '-Wmissing-include-dirs',
136 '-Wunused-but-set-variable',
137 '-Warray-bounds',
138 '-Wimplicit-function-declaration',
139 '-Wreturn-type',
140 '-Wswitch-enum',
141 '-Wswitch-default',
142 '-Wduplicated-cond',
143 '-Wduplicated-branches',
144 '-Wlogical-op',
145 '-Wrestrict',
146 '-Wnull-dereference',
147 '-Wjump-misses-init',
148 '-Wdouble-promotion'
149106 ]
150
151107 c_compiler = meson.get_compiler('c')
152108 supported_warning_cflags = c_compiler.get_supported_arguments(warning_cflags)
153109 add_project_arguments(supported_warning_cflags, language : 'c')
154 ##### end CFLAGS
155110
156111 subdir('data')
157112 subdir('plugins/gedit-plugin')