]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Move signers-pkcs11 to a separate library
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 6 Feb 2024 15:15:26 +0000 (16:15 +0100)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:59 +0000 (13:28 +0100)
meson.build

index 12f3fd3bfe49f19e0dc6d8b4753e3b58419520c9..fbc9d9451933277da275be7cd97348517f453668 100644 (file)
@@ -240,13 +240,6 @@ conditional_sources = {
     'sources': [src_dir / 'decafsigners.cc'],
     'condition': dep_libdecaf.found(),
   },
-  'signers-pkcs11': {
-    'sources': [
-      src_dir / 'pkcs11signers.cc',
-      src_dir / 'pkcs11signers.hh',
-    ],
-    'condition': dep_pkcs11.found(),
-  },
   'standalone-fuzz-target-runner': {
     'sources': [src_dir / 'standalone_fuzz_target_runner.cc'],
     'condition': get_option('fuzz-targets'),
@@ -259,6 +252,18 @@ foreach name, info: conditional_sources
   endif
 endforeach
 
+# Conditional sources that need to be separated into standalone libraries.
+libpdns_signers_pkcs11 = dependency('', required: false)
+if dep_pkcs11.found()
+  libpdns_signers_pkcs11 = declare_dependency(
+    link_whole: static_library(
+      'pdns-signers-pkcs11',
+      sources: files(src_dir / 'pkcs11signers.cc', src_dir / 'pkcs11signers.hh'),
+      dependencies: dep_pkcs11,
+    )
+  )
+endif
+
 # This needs to be link_whole'd because it's needed by auth backends.
 libpdns_ssqlite3 = dependency('', required: false)
 if dep_sqlite3.found()
@@ -722,7 +727,7 @@ libpdns_common = static_library(
   'pdns-common',
   common_sources,
   config_h,
-  dependencies: deps,
+  dependencies: [deps, libpdns_signers_pkcs11],
   link_with: [libpdns_bindparser, libpdns_dnslabeltext],
 )