[libsoup/wip/meson: 87/93] Enable extra warnings if compiler supports them



commit c3e5a61a693800d5c9ef4190b3f8189eca31c99f
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Feb 12 11:32:25 2018 +0100

    Enable extra warnings if compiler supports them

 meson.build |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/meson.build b/meson.build
index 964ef0e..824bc30 100644
--- a/meson.build
+++ b/meson.build
@@ -40,7 +40,6 @@ endif
 
 libxml_dep = dependency('libxml-2.0', required: cc.get_id() != 'msvc')
 
-
 # Fallback check for libxml2 on Visual Studio, which normally does not
 # generate a pkg-config file upon a successful build
 if not libxml_dep.found()
@@ -59,6 +58,25 @@ if host_machine.system() == 'windows'
   cdata.set('DLL_EXPORT', 1)
 endif
 
+# Enable extra warnings if compiler supports them.
+foreach arg : [
+    '-Wall',
+    '-Wmissing-include-dirs',
+    '-Wpointer-arith',
+    '-Winit-self',
+    '-Wdeclaration-after-statement',
+    '-Werror=missing-prototypes',
+    '-Werror=implicit-function-declaration',
+    '-Werror=aggregate-return',
+    '-Werror=format=2',
+    '-Wstrict-prototypes',
+    '-Wno-format-zero-length',
+  ]
+  if cc.has_argument(arg)
+     add_project_arguments(arg, language : 'c')
+  endif
+endforeach
+
 ###################
 # GIO TLS support #
 ###################


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