meson: Use feature options everywhere it makes sense

This commit is contained in:
Thibault Saunier 2021-03-10 15:36:27 -03:00 committed by Wim Taymans
parent 98bedb3895
commit 485bae5eb0
20 changed files with 211 additions and 224 deletions

View file

@ -54,7 +54,7 @@ if ncurses_dep.found()
)
endif
if get_option('pw-cat') and sndfile_dep.found()
if not get_option('pw-cat').disabled() and sndfile_dep.found()
pwcat_sources = [
'pw-cat.c',
@ -80,5 +80,6 @@ if get_option('pw-cat') and sndfile_dep.found()
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pw-cat', dst)
meson.add_install_script('sh', '-c', cmd)
endforeach
elif not sndfile_dep.found() and get_option('pw-cat').enabled()
error('pw-cat is enabled but required dependency `sndfile` was not found.')
endif