libnm/build: always compile both crypto backends if library available

We want to see that both backends can actually compile -- at least,
if we have the dependencies detected.
This commit is contained in:
Thomas Haller
2021-02-17 16:03:23 +01:00
parent fdf9614ba7
commit 243051a8a6
2 changed files with 38 additions and 16 deletions

View File

@@ -530,20 +530,23 @@ if polkit_agent_helper_1_path[0] != '/'
endif
config_h.set_quoted('POLKIT_AGENT_HELPER_1_PATH', polkit_agent_helper_1_path)
crypto_nss_dep = dependency(
'nss',
required: false,
)
crypto_gnutls_dep = dependency(
'gnutls',
version: '>= 2.12',
required: false,
)
crypto = get_option('crypto')
if crypto == 'nss'
crypto_dep = dependency('nss', required: false)
assert(crypto_dep.found(), 'Requires nss crypto support')
elif crypto == 'gnutls'
crypto_dep = dependency(
'gnutls',
version: '>= 2.12',
required: false,
)
assert(crypto_dep.found(), 'Requires gnutls crypto support')
assert(crypto_nss_dep.found(), 'Requires nss crypto support')
crypto_dep = crypto_nss_dep
else
error('bug')
assert(crypto == 'gnutls', 'Unexpected setting "crypto=' + crypto + '"')
assert(crypto_gnutls_dep.found(), 'Requires gnutls crypto support')
crypto_dep = crypto_gnutls_dep
endif
dbus_conf_dir = get_option('dbus_conf_dir')

View File

@@ -2,20 +2,39 @@
libnm_core_impl_inc = include_directories('.')
# FIXME: compile both crypto backends.
libnm_crypto = static_library(
'nm-crypto',
sources: 'nm-crypto-@0@.c'.format(crypto),
libnm_crypto_nss = static_library(
'nm-crypto-nss',
sources: 'nm-crypto-nss.c',
dependencies: [
libnm_core_public_dep,
crypto_dep,
libnm_glib_aux_dep_link,
crypto_nss_dep,
],
c_args: [
'-DG_LOG_DOMAIN="libnm"',
],
)
libnm_crypto_gnutls = static_library(
'nm-crypto-gnutls',
sources: 'nm-crypto-gnutls.c',
dependencies: [
libnm_core_public_dep,
libnm_glib_aux_dep_link,
crypto_gnutls_dep,
],
c_args: [
'-DG_LOG_DOMAIN="libnm"',
],
)
if crypto == 'nss'
libnm_crypto = libnm_crypto_nss
else
assert(crypto == 'gnutls', 'Unexpected setting "crypto=' + crypto + '"')
libnm_crypto = libnm_crypto_gnutls
endif
libnm_core_settings_sources = files(
'nm-setting-6lowpan.c',
'nm-setting-8021x.c',