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:
Andrei Alexeyev 2019-10-03 03:22:54 +03:00
parent 80dbd62509
commit 69dc964c22
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
2 changed files with 17 additions and 0 deletions

View file

@ -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']

View file

@ -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'
)