meson: Fix crypto option being silently ignored

If you pass an option to enable a crypto backend it just silently
moves on when nothing is found. This is not how a build system
should behave and will lead to mistakes. The disabled option exists
for that purpose.
This commit is contained in:
Patrick Griffis 2024-02-16 12:58:12 -06:00
parent 9ee98781bc
commit 257d521cb9

View File

@ -41,26 +41,20 @@ if get_option('crypto') == 'libgcrypt'
gcrypt_dep = dependency( gcrypt_dep = dependency(
'libgcrypt', 'libgcrypt',
version: '>=' + min_libgcrypt_version, version: '>=' + min_libgcrypt_version,
required: false,
) )
if gcrypt_dep.found()
with_gcrypt = true with_gcrypt = true
with_crypto = true with_crypto = true
crypto_deps += gcrypt_dep crypto_deps += gcrypt_dep
endif
elif get_option('crypto') == 'gnutls' elif get_option('crypto') == 'gnutls'
min_gnutls_version = '3.8.2' min_gnutls_version = '3.8.2'
gnutls_dep = dependency( gnutls_dep = dependency(
'gnutls', 'gnutls',
version: '>=' + min_gnutls_version, version: '>=' + min_gnutls_version,
required: false,
) )
if gnutls_dep.found()
with_gnutls = true with_gnutls = true
with_crypto = true with_crypto = true
crypto_deps += gnutls_dep crypto_deps += gnutls_dep
endif endif
endif
min_tss2_version = '3.0.3' min_tss2_version = '3.0.3'
tss2_esys = dependency('tss2-esys', version: '>=' + min_tss2_version, required: get_option('tpm2')) tss2_esys = dependency('tss2-esys', version: '>=' + min_tss2_version, required: get_option('tpm2'))