build: Set default warning_level=3 20/278120/1 sandbox/actiontest accepted/tizen/unified/20220718.140337 submit/tizen/20220718.065110
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 13 Jul 2022 06:39:36 +0000 (15:39 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:09:09 +0000 (14:09 +0900)
This patch suppresses 'unused-parameter' and 'pedantic' GCC warnings
that we don't care about.

After suppressing these warnings, we can now enable the highest
warning_level by default.

Change-Id: I4402766a5cdabd6984582c17805c41c1f8a66645

meson.build

index be7d520..03d6bc7 100644 (file)
@@ -2,12 +2,26 @@ project('libds', 'c',
   license: 'MIT',
   version: '0.1.2',
   default_options: [
-    'warning_level=1',
+    'warning_level=3',
     'c_std=gnu99',
     'buildtype=debug'
   ]
 )
 
+cc = meson.get_compiler('c')
+
+global_args = []
+global_args_maybe = [
+  '-Wno-unused-parameter',
+  '-Wno-pedantic',
+]
+foreach a : global_args_maybe
+  if cc.has_argument(a)
+    global_args += a
+  endif
+endforeach
+add_global_arguments(global_args, language: 'c')
+
 libds_version = meson.project_version()
 version_arr = libds_version.split('.')
 libds_version_major = version_arr[0]
@@ -43,4 +57,4 @@ subdir('examples')
 subdir('clients')
 subdir('include')
 
-configure_file(output: 'config.h', install: false, configuration: cdata)
\ No newline at end of file
+configure_file(output: 'config.h', install: false, configuration: cdata)