]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Create libpdns_cdb and use it in the tinydnsbackend
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 6 Nov 2023 09:28:57 +0000 (10:28 +0100)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:54 +0000 (13:28 +0100)
modules/tinydnsbackend/meson.build
pdns/meson.build

index 0e0e76d12985ae2eb325c15dc074c469dac5e20b..4f809ea5590075ea09ef19d8aa7a445ae71ee507 100644 (file)
@@ -1,15 +1,12 @@
 sources = [
   'tinydnsbackend.cc',
-  # TODO Change this into a libpdns library
-  product_source_dir / 'pdns' / 'cdb.cc',
 ]
 
 extras = [
   'tinydnsbackend.hh',
-  product_source_dir / 'pdns' / 'cdb.hh',
 ]
 
-module_deps = [deps, dep_cdb]
+module_deps = [deps, dep_cdb, libpdns_cdb]
 
 lib = static_library(
   module_backend_name,
index 1a40dba56f63c8fbb456071285a29f44ae31c2e3..385aa23bb6227b84869ce124f775497804acd58c 100644 (file)
@@ -1,5 +1,21 @@
 fs = import('fs')
 
+libpdns_cdb = dependency('', required: false)
+if dep_cdb.found()
+  libpdns_cdb = declare_dependency(
+    link_whole: static_library(
+      'libpdns-cdb',
+      'cdb.cc',
+      extra_files: [
+        'cdb.hh',
+      ],
+      dependencies: [
+        deps,
+      ],
+    )
+  )
+endif
+
 libpdns_bindlexer_cc = 'bindlexer.c'
 if not fs.is_file(libpdns_bindlexer_cc)
   flex = find_program('flex', required: true)