meson: use not_found_message when dependencies are not found
The default state of `dependency()` is `required: true`, which means if a dependency is not found, meson immediately aborts and does not log our `error()` messages. meson 0.50 has builtin support for dependencies with custom error messages. The alternative would be to specify `required: false` everywhere, and only then to key off of `dep.found()`. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
83f428d974
commit
e7a2b2764a
1 changed files with 4 additions and 8 deletions
12
meson.build
12
meson.build
|
@ -130,17 +130,13 @@ endif
|
|||
|
||||
want_crypto = get_option('crypto')
|
||||
if want_crypto == 'openssl'
|
||||
libcrypto = dependency('libcrypto', static : get_option('buildstatic'))
|
||||
if not libcrypto.found()
|
||||
error('openssl support requested but not found')
|
||||
endif
|
||||
libcrypto = dependency('libcrypto', static : get_option('buildstatic'),
|
||||
not_found_message : 'openssl support requested but not found')
|
||||
crypto_provider = libcrypto
|
||||
conf.set10('HAVE_LIBSSL', true)
|
||||
elif want_crypto == 'nettle'
|
||||
libnettle = dependency('nettle', static : get_option('buildstatic'))
|
||||
if not libnettle.found()
|
||||
error('nettle support requested but not found')
|
||||
endif
|
||||
libnettle = dependency('nettle', static : get_option('buildstatic'),
|
||||
not_found_message : 'nettle support requested but not found')
|
||||
crypto_provider = libnettle
|
||||
conf.set10('HAVE_LIBNETTLE', true)
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue