summary refs log tree commit diff
path: root/libnm-util
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-09-15 01:04:32 +0200
committerMichael Biebl <biebl@debian.org>2018-09-15 01:04:32 +0200
commitc240974325c552cad177c457d6ff04e381fd77a3 (patch)
tree2fe5561359b767db15292c84447be8075a75388a /libnm-util
parent8f7a3cbbdd0c0a48277c341dd3a8ec8743ae9735 (diff)
New upstream version 1.14.0 upstream/1.14.0
Diffstat (limited to 'libnm-util')
-rw-r--r--libnm-util/meson.build32
1 files changed, 28 insertions, 4 deletions
diff --git a/libnm-util/meson.build b/libnm-util/meson.build
index da807bc6..44d9e735 100644
--- a/libnm-util/meson.build
+++ b/libnm-util/meson.build
@@ -57,7 +57,6 @@ libnm_utils_enum = gnome.mkenums(
 
 sources = files(
   'crypto.c',
-  'crypto_' + crypto + '.c',
   'nm-connection.c',
   'nm-param-spec-specialized.c',
   'nm-setting-8021x.c',
@@ -93,7 +92,6 @@ sources = files(
 sources += shared_files_libnm_util
 
 deps = [
-  crypto_dep,
   dbus_dep,
   dbus_glib_dep,
   shared_dep,
@@ -108,6 +106,32 @@ cflags = common_cflags + [
   '-DG_LOG_DOMAIN="@0@"'.format(libnm_util_name)
 ]
 
+if crypto_gnutls_dep.found()
+  libnm_util_crypto_gnutls = static_library(
+    'nm-util-crypto-gnutls',
+    sources: [ 'crypto_gnutls.c' ],
+    dependencies: deps + [ crypto_gnutls_dep ],
+    c_args: cflags
+  )
+endif
+
+if crypto_nss_dep.found()
+  libnm_util_crypto_nss = static_library(
+    'nm-util-crypto-nss',
+    sources: [ 'crypto_nss.c' ],
+    dependencies: deps + [ crypto_nss_dep ],
+    c_args: cflags
+  )
+endif
+
+if crypto == 'gnutls'
+  libnm_util_crypto = libnm_util_crypto_gnutls
+elif crypto == 'nss'
+  libnm_util_crypto = libnm_util_crypto_nss
+else
+  error('bug')
+endif
+
 linker_script = join_paths(meson.current_source_dir(), 'libnm-util.ver')
 
 libnm_util = shared_library(
@@ -120,6 +144,7 @@ libnm_util = shared_library(
     '-Wl,--version-script,@0@'.format(linker_script),
   ],
   link_depends: linker_script,
+  link_with: libnm_util_crypto,
   install: true
 )
 
@@ -174,11 +199,9 @@ test(
 
 sources = files(
   'crypto.c',
-  'crypto_' + crypto + '.c'
 )
 
 deps = [
-  crypto_dep,
   shared_dep
 ]
 
@@ -186,6 +209,7 @@ libtest_crypto = static_library(
   'test-crypto',
   sources: sources,
   dependencies: deps,
+  link_with: libnm_util_crypto,
   c_args: cflags
 )