summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-02-12 11:32:25 +0100
committerTomas Popela <tpopela@redhat.com>2018-04-11 12:39:20 +0200
commitc3e5a61a693800d5c9ef4190b3f8189eca31c99f (patch)
tree2b451f55a613b3ebebde9aac2861dbeb45ca6aa0
parent9194a24a9d083f5c38beae9c4f9cfa444b3bd2b7 (diff)
downloadlibsoup-c3e5a61a693800d5c9ef4190b3f8189eca31c99f.tar.gz
Enable extra warnings if compiler supports them
-rw-r--r--meson.build20
1 files changed, 19 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 964ef0eb..824bc304 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 #
###################