summaryrefslogtreecommitdiffstats
path: root/modules/dnstap/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 20:37:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 20:37:50 +0000
commitc1f743ab2e4a7046d5500875a47d1f62c8624603 (patch)
tree709946d52f5f3bbaeb38be9e3f1d56d11f058237 /modules/dnstap/meson.build
parentInitial commit. (diff)
downloadknot-resolver-upstream/5.7.1.tar.xz
knot-resolver-upstream/5.7.1.zip
Adding upstream version 5.7.1.upstream/5.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/dnstap/meson.build')
-rw-r--r--modules/dnstap/meson.build57
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/dnstap/meson.build b/modules/dnstap/meson.build
new file mode 100644
index 0000000..e8a94bf
--- /dev/null
+++ b/modules/dnstap/meson.build
@@ -0,0 +1,57 @@
+# C module: dnstap
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+dnstap_src = files([
+ 'dnstap.c',
+])
+
+## dnstap dependencies
+build_dnstap = false
+if get_option('dnstap') != 'disabled'
+ dnstap_required = get_option('dnstap') == 'enabled'
+ message('--- dnstap module dependencies ---')
+ libprotobuf_c = dependency('libprotobuf-c', version: '>=1', required: dnstap_required)
+ libfstrm = dependency('libfstrm', version: '>=0.2', required: dnstap_required)
+ protoc_c = find_program('protoc-c', required: dnstap_required)
+ message('----------------------------------')
+ if libprotobuf_c.found() and libfstrm.found() and protoc_c.found()
+ build_dnstap = true
+ endif
+endif
+
+
+if build_dnstap
+ c_src_lint += dnstap_src
+
+ # generate protobuf-c sources using protoc-c
+ dnstap_pb = custom_target(
+ 'dnstap_pb',
+ command: [
+ protoc_c,
+ '--c_out=' + meson.current_build_dir(),
+ '--proto_path', meson.current_source_dir(),
+ meson.current_source_dir() / 'dnstap.proto',
+ ],
+ input: [ 'dnstap.proto' ],
+ output: [
+ 'dnstap.pb-c.h',
+ 'dnstap.pb-c.c',
+ ],
+ )
+
+ # build dnstap module
+ dnstap_mod = shared_module(
+ 'dnstap',
+ dnstap_src,
+ dependencies: [
+ declare_dependency(sources: dnstap_pb),
+ libfstrm,
+ libprotobuf_c,
+ libknot,
+ ],
+ include_directories: mod_inc_dir,
+ name_prefix: '',
+ install: true,
+ install_dir: modules_dir,
+ )
+endif