[gnome-logs] meson: add warning cflags



commit 27b52b9d267977266187a3947073222b81e8a793
Author: Jonathan Kang <jonathan121537 gmail com>
Date:   Mon Jan 8 15:56:10 2018 +0800

    meson: add warning cflags
    
    As a port of AX_COMPILER_FLAGS which is supposed to replace
    GNOME_COMPILE_WARNINGS, add needed warning cflags in main meson.build
    file.

 meson.build |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/meson.build b/meson.build
index ff5b766..a46148f 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,23 @@ gl_datadir = join_paths(gl_prefix, get_option('datadir'))
 gl_mandir = join_paths(gl_prefix, get_option('mandir'), 'man1')
 gl_pkgdatadir = join_paths(gl_datadir, gl_name)
 
-#TODO add debug arguments
+# warning cflags
+warning_cflags = [
+    '-Wall',
+    '-Wstrict-prototypes',
+    '-Wnested-externs',
+    '-Werror=missing-prototypes',
+    '-Werror=implicit-function-declaration',
+    '-Werror=pointer-arith',
+    '-Werror=init-self',
+    '-Werror=format-security',
+    '-Werror=format=2',
+    '-Werror=missing-include-dirs',
+    '-Werror=return-type'
+]
+c_compiler = meson.get_compiler('c')
+supported_warning_cflags = c_compiler.get_supported_arguments(warning_cflags)
+add_global_arguments(supported_warning_cflags, language : 'c')
 
 config_h = configuration_data()
 


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