[glib] build: meson: add warning flags



commit 9d24c8b223ec4253e3c6a2e14001de61fa993dbb
Author: Ernestas Kulik <ernestask gnome org>
Date:   Fri Feb 16 19:14:08 2018 +0200

    build: meson: add warning flags
    
    Courtesy of GTK+.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793399

 meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
---
diff --git a/meson.build b/meson.build
index bb0419ed5..de12b8811 100644
--- a/meson.build
+++ b/meson.build
@@ -269,6 +269,27 @@ foreach m : struct_members
   endif
 endforeach
 
+# Compiler flags
+if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
+  test_c_args = [
+    '-Wall',
+    '-Wduplicated-branches',
+    '-Wstrict-prototypes',
+    '-Werror=declaration-after-statement',
+    '-Werror=format=2',
+    '-Werror=format-security',
+    '-Werror=implicit-function-declaration',
+    '-Werror=init-self',
+    '-Werror=missing-include-dirs',
+    '-Werror=missing-prototypes',
+    '-Werror=pointer-arith',
+  ]
+else
+  test_c_args = []
+endif
+
+add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
+
 # Windows Support (Vista+)
 if host_system == 'windows'
   glib_conf.set('_WIN32_WINNT', '0x0601')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]