build/meson: fix when crypto libraries are built

Only do so when the dependencies are found.

Fixes: 243051a8a6 ('libnm/build: always compile both crypto backends if library available')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/934
This commit is contained in:
Maxine Aubrey 2021-07-18 13:59:10 +02:00 committed by Thomas Haller
parent 9fcf532df3
commit bdfaa4520e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2,23 +2,27 @@
libnm_core_impl_inc = include_directories('.')
libnm_crypto_nss = static_library(
'nm-crypto-nss',
sources: 'nm-crypto-nss.c',
dependencies: [
libnm_core_public_dep,
crypto_nss_dep,
],
)
if crypto_nss_dep.found()
libnm_crypto_nss = static_library(
'nm-crypto-nss',
sources: 'nm-crypto-nss.c',
dependencies: [
libnm_core_public_dep,
crypto_nss_dep,
],
)
endif
libnm_crypto_gnutls = static_library(
'nm-crypto-gnutls',
sources: 'nm-crypto-gnutls.c',
dependencies: [
libnm_core_public_dep,
crypto_gnutls_dep,
],
)
if crypto_gnutls_dep.found()
libnm_crypto_gnutls = static_library(
'nm-crypto-gnutls',
sources: 'nm-crypto-gnutls.c',
dependencies: [
libnm_core_public_dep,
crypto_gnutls_dep,
],
)
endif
if crypto == 'nss'
libnm_crypto = libnm_crypto_nss