[devhelp] build: do not try to mimic AX_COMPILER_FLAGS



commit 3d07778f2a588e8c38976b0307d10a30e26551e9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Nov 11 10:27:58 2019 +0100

    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.

 meson.build | 51 +++------------------------------------------------
 1 file changed, 3 insertions(+), 48 deletions(-)
---
diff --git a/meson.build b/meson.build
index 77e57b04..55987a87 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,8 @@
 project(
   'devhelp', 'c',
   meson_version : '>= 0.47',
-  version : '3.34.0'
+  version : '3.34.0',
+  default_options : ['warning_level=2']
 )
 
 GNOME = import('gnome')
@@ -99,60 +100,14 @@ add_project_arguments(
   language : 'c'
 )
 
-#####
-# CFLAGS
-# (This is one of the ugly parts of Meson, currently.)
-# The same as the AX_COMPILER_FLAGS Autotools macro.
-
+# Additional CFLAGS.
 warning_cflags = [
-  '-fno-strict-aliasing',
-  '-Wall',
-  '-Wextra',
-  '-Wundef',
-  '-Wnested-externs',
-  '-Wwrite-strings',
-  '-Wpointer-arith',
-  '-Wmissing-declarations',
-  '-Wmissing-prototypes',
-  '-Wstrict-prototypes',
-  '-Wredundant-decls',
   '-Wno-unused-parameter',
   '-Wno-missing-field-initializers',
-  '-Wdeclaration-after-statement',
-  '-Wformat=2',
-  '-Wold-style-definition',
-  '-Wcast-align',
-  '-Wformat-nonliteral',
-  '-Wformat-security',
-  '-Wsign-compare',
-  '-Wstrict-aliasing',
-  '-Wshadow',
-  '-Winline',
-  '-Wpacked',
-  '-Wmissing-format-attribute',
-  '-Wmissing-noreturn',
-  '-Winit-self',
-  '-Wredundant-decls',
-  '-Wmissing-include-dirs',
-  '-Wunused-but-set-variable',
-  '-Warray-bounds',
-  '-Wimplicit-function-declaration',
-  '-Wreturn-type',
-  '-Wswitch-enum',
-  '-Wswitch-default',
-  '-Wduplicated-cond',
-  '-Wduplicated-branches',
-  '-Wlogical-op',
-  '-Wrestrict',
-  '-Wnull-dereference',
-  '-Wjump-misses-init',
-  '-Wdouble-promotion'
 ]
-
 c_compiler = meson.get_compiler('c')
 supported_warning_cflags = c_compiler.get_supported_arguments(warning_cflags)
 add_project_arguments(supported_warning_cflags, language : 'c')
-##### end CFLAGS
 
 subdir('data')
 subdir('plugins/gedit-plugin')


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