diff options
author | Oz Tiram <[email protected]> | 2025-04-01 09:46:59 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2025-04-04 22:19:13 +0000 |
commit | 9983a88d726b73f85caafdc700302de04dbcbc61 (patch) | |
tree | 6f69133c025a0a0d6f2d63706dec001893c5052f | |
parent | 2085c6c8e734ec64081b08be6df13b1ebdf6adb8 (diff) | |
download | atril-9983a88d726b73f85caafdc700302de04dbcbc61.tar.bz2 atril-9983a88d726b73f85caafdc700302de04dbcbc61.tar.xz |
chore: add maintainer mode
Replacing MATE_MAINTAINER_MODE_DEFINES in configure.ac.
Signed-off-by: Oz Tiram <[email protected]>
-rw-r--r-- | meson.build | 42 | ||||
-rw-r--r-- | meson_options.txt | 6 |
2 files changed, 39 insertions, 9 deletions
diff --git a/meson.build b/meson.build index f1b8a45b..a0acafeb 100644 --- a/meson.build +++ b/meson.build @@ -191,24 +191,48 @@ cpp_args = [ '-DHAVE_CONFIG_H', ] +# Check if maintainer mode is enabled +if get_option('maintainer_mode') + # Define the domains to disable deprecated APIs for + domains = ['G', 'ATK', 'PANGO', 'GDK', 'GDK_PIXBUF', 'GTK', 'MATE', 'LIBGLADE', 'VTE', 'WNCK', 'LIBSOUP'] + + # Create the compiler arguments to DISABLE deprecated APIs + disable_deprecated_flags = [] + foreach domain : domains + disable_deprecated_flags += '-D@0@_DISABLE_DEPRECATED'.format(domain) + disable_deprecated_flags += '-D@0@_DISABLE_SINGLE_INCLUDES'.format(domain) + endforeach + + # Add these flags to c_args and cpp_args + c_args += disable_deprecated_flags + cpp_args += disable_deprecated_flags +endif + if get_option('enable_debug') - c_args += '-DEV_ENABLE_DEBUG' + c_args += '-DEV_ENABLE_DEBUG' + cpp_args += '-DEV_ENABLE_DEBUG' endif if get_option('epub') - c_args += '-DENABLE_EPUB' + c_args += '-DENABLE_EPUB' + cpp_args += '-DENABLE_EPUB' endif if not get_option('deprecated_warnings') - c_args += [ - '-Wno-deprecated-declarations', - '-Wno-deprecated', - '-Wno-declaration-after-statement', - ] + c_args += [ + '-Wno-deprecated-declarations', + '-Wno-deprecated', + '-Wno-declaration-after-statement', + ] + cpp_args += [ + '-Wno-deprecated-declarations', + '-Wno-deprecated', + ] endif -add_global_arguments(c_args, language: 'c') -add_global_arguments(cpp_args, language: ['c', 'cpp']) +# Add all arguments at once +add_project_arguments(c_args, language: 'c') +add_project_arguments(cpp_args, language: 'cpp') subdir('libdocument') subdir('libview') diff --git a/meson_options.txt b/meson_options.txt index 3f25dc32..eaa5b17d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -103,3 +103,9 @@ option('enable_debug', value: false, description: 'Enable the runtime debugger' ) + +option('maintainer_mode', + type: 'boolean', + value: true, + description: 'Enable maintainer mode (extra warnings for deprecated APIs)' +) |