[gthumb] meson: added option to disable deprecated declaration warnings



commit c172525425d0210270d5407c49a78924846f1e1d
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Nov 1 14:27:28 2019 +0100

    meson: added option to disable deprecated declaration warnings

 meson.build       | 7 ++++++-
 meson_options.txt | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 7346bf23..2566d2a8 100644
--- a/meson.build
+++ b/meson.build
@@ -303,6 +303,7 @@ config_inc = include_directories('.')
 
 c_args = []
 if get_option('buildtype').contains('debug')
+  warn_deprecated = get_option('warn-deprecated')
   test_args = [
     '-Wall',
     '-Wcast-align',
@@ -317,9 +318,12 @@ if get_option('buildtype').contains('debug')
     '-Wformat-security'
   ]
 else
-  c_args += [ '-Wno-deprecated-declarations' ]
+  warn_deprecated = false
   test_args = [ '-Wall' ]
 endif
+if not(warn_deprecated)
+  test_args += [ '-Wno-deprecated-declarations' ]
+endif
 c_args += c_comp.get_supported_arguments(test_args)
 
 # Subdirectories
@@ -340,6 +344,7 @@ summary = [
   '               api: @0@'.format(api_version),
   '            prefix: @0@'.format(prefix),
   '      run in place: @0@'.format(get_option('run-in-place')),
+  '   warn deprecated: @0@'.format(warn_deprecated),
   '             exiv2: @0@'.format(use_exiv2),
   '           clutter: @0@'.format(use_clutter),
   '         gstreamer: @0@'.format(use_gstreamer),
diff --git a/meson_options.txt b/meson_options.txt
index 6cc50178..e34b80c6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,9 @@
+option('warn-deprecated',
+  type : 'boolean',
+  value : true,
+  description : 'Enable deprecated declaration warnings in debug mode'
+)
+
 option('run-in-place',
   type : 'boolean',
   value : false,


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