Add deprecation_warnings option
Controls treatment of warnings caused by attr_deprecated. Can be one of the following values: * default: No special treatment. * error: Always treat as errors, regardless of the werror option. * no-error: Never treat as errors, regardless of the werror option. * ignore: Suppress the warnings.
This commit is contained in:
parent
80dbd62509
commit
69dc964c22
2 changed files with 17 additions and 0 deletions
10
meson.build
10
meson.build
|
@ -90,6 +90,16 @@ taisei_c_args = [
|
|||
'-fno-trapping-math',
|
||||
]
|
||||
|
||||
deprecation_warnings = get_option('deprecation_warnings')
|
||||
|
||||
if deprecation_warnings == 'error'
|
||||
taisei_c_args += '-Werror=deprecated-declarations'
|
||||
elif deprecation_warnings == 'no-error'
|
||||
taisei_c_args += '-Wno-error=deprecated-declarations'
|
||||
elif deprecation_warnings == 'ignore'
|
||||
taisei_c_args += '-Wno-deprecated-declarations'
|
||||
endif
|
||||
|
||||
if meson.version().version_compare('<0.50.0') and get_option('b_pch')
|
||||
# Workaround for Meson bug: https://github.com/mesonbuild/meson/issues/4905
|
||||
taisei_c_args += ['-fpch-deps']
|
||||
|
|
|
@ -183,3 +183,10 @@ option(
|
|||
choices : ['auto', 'true', 'false'],
|
||||
description : 'Use libcrypto from OpenSSL for better SHA implementations'
|
||||
)
|
||||
|
||||
option(
|
||||
'deprecation_warnings',
|
||||
choices : ['default', 'error', 'no-error', 'ignore'],
|
||||
type : 'combo',
|
||||
description : 'Treatment of deprecation warnings'
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue