mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
meson: disable warnings about unused variables for NDEBUG builds
With assertions disabled, we'd get a bunch of warnings that really bring no value. With this change, a default meson build with -Db_ndebug=true generates no warnings.
This commit is contained in:
parent
ee36fed438
commit
a73f621384
10
meson.build
10
meson.build
@ -383,6 +383,16 @@ if get_option('buildtype') != 'debug'
|
||||
possible_link_flags += '-Wl,--gc-sections'
|
||||
endif
|
||||
|
||||
if get_option('b_ndebug') == 'true'
|
||||
# With asserts disabled with get a bunch of warnings about variables which
|
||||
# are used only in the asserts. This is not useful at all, so let's just silence
|
||||
# those warnings.
|
||||
possible_cc_flags += [
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-but-set-variable',
|
||||
]
|
||||
endif
|
||||
|
||||
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
|
||||
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user