+# client
+
kresc_src = [
'kresc.c',
]
-# client dependencies
+message('--- kresc dependencies ---')
libedit = dependency('libedit', required: false)
if not libedit.found()
# TODO why call find_library? osx workaround?
libedit = meson.get_compiler('c').find_library('edit')
endif
+message('--------------------------')
# build
# embed lua to daemon
if get_option('daemon')
- # dependencies
+ message('--- required kresd dependencies ---')
xxd = find_program('xxd', required: false)
if not xxd.found()
hexdump = find_program('hexdump')
endif
+ embed_lua = find_program('../../scripts/embed-lua.sh')
+ message('--------------------------------------')
embed_lua = generator(
- find_program('../../scripts/embed-lua.sh'),
+ embed_lua,
arguments: ['@INPUT@'],
output: '@BASENAME@.inc',
capture: true,
['cache.clear', files('cache.test/clear.test.lua')],
]
-subdir('lua')
-
lib_suffix = '.so'
# TODO seek&destroy LIBEXT
'pkg-config', ['luajit', '--atleast-version', '2.1.0-beta3']
).returncode() == 0 ? '1' : '0'
-
# daemon CFLAGS
c_args = [
'-fPIE', # NOTE this triggers warning, but is needed for compatibility with meson 0.47.0
'-DLUA_HAS_SETFUNCS=@0@'.format(luajit_has_setfuncs),
]
-
# TODO test build on osx
if host_machine.system() == 'darwin'
# luajit workaround for OS X https://luajit.org/install.html#embed
endif
-if get_option('daemon')
- # optional systemd socket activation
- libsystemd = dependency('libsystemd', version: '>=227', required: false)
- if libsystemd.found()
- c_args += ['-DHAS_SYSTEMD']
- endif
+# optional systemd socket activation
+message('--- optional kresd dependencies ---')
+libsystemd = dependency('libsystemd', version: '>=227', required: false)
+if libsystemd.found()
+ c_args += ['-DHAS_SYSTEMD']
+ config.set('man_seealso_systemd', '\fIkresd.systemd(7)\fR,')
+endif
+message('-----------------------------------')
+
+subdir('lua')
+
+
+if get_option('daemon')
# build
kresd = executable(
'kresd',
# documentation
if get_option('doc') # doxygen + html docs
- # doc dependencies
+ message('--- doc dependencies ---')
doxygen = find_program('doxygen')
sphinx_build = find_program('sphinx-build')
error('missing doc dependency: python breathe')
endif
endif
+ message('------------------------')
# create doxygen in source dir
doc_doxyxml = custom_target(
)
-# Project-wide dependencies
-
+message('--- required dependencies ---')
knot_version = '>=2.7.6'
libknot = dependency('libknot', version: knot_version)
libdnssec = dependency('libdnssec', version: knot_version)
lmdb = dependency('lmdb')
gnutls = dependency('gnutls')
luajit = dependency('luajit')
+message('------------------------------')
# TODO coverage
# files(module.lua)
]
-# List of tests
+# Lists of tests
# These lists are added to from subdir() and finally used in tests/*
unit_tests = [
]
## dnstap dependencies
+message('--- dnstap module dependencies ---')
libprotobuf_c = dependency('libprotobuf-c', version: '>=1', required: false)
libfstrm = dependency('libfstrm', version: '>=0.2', required: false)
protoc_c = find_program('protoc-c', required: false)
+message('----------------------------------')
# build dnstap if deps are found
-if not libprotobuf_c.found() or not libfstrm.found() or not protoc_c.found()
- message('dnstap module: skipping build')
-else
+if libprotobuf_c.found() and libfstrm.found() and protoc_c.found()
# generate protobuf-c sources using protoc-c
dnstap_pb = custom_target(
'dnstap_pb',
+# tests
+
+message('--- unit test dependencies ---')
+cmocka = dependency('cmocka', required: false)
+if cmocka.found()
+ subdir('unit')
+endif
+message('------------------------------')
+
subdir('config')
-subdir('unit')
if get_option('extra_tests')
+ message('--- extra_tests dependencies ---')
python3 = find_program('python3')
py3_deps = []
error('missing python3 dependency: @0@'.format(py3_dep[1]))
endif
endforeach
+ message('--------------------------------')
endif
# tests: unit
-# dependency
-cmocka = dependency('cmocka', required: false)
+# mock module for test_module
+mock_cmodule_src = [
+ 'mock_cmodule.c',
+]
-if cmocka.found()
+mock_cmodule_lib = library(
+ 'mock_cmodule',
+ mock_cmodule_src,
+ name_prefix: '',
+ dependencies: libkres_dep,
+)
- # mock module for test_module
- mock_cmodule_src = [
- 'mock_cmodule.c',
- ]
+mock_cmodule_dep = declare_dependency(
+ link_with: mock_cmodule_lib,
+)
- mock_cmodule_lib = library(
- 'mock_cmodule',
- mock_cmodule_src,
- name_prefix: '',
- dependencies: libkres_dep,
+# executables with tests
+foreach unit_test : unit_tests
+ exec_test = executable(
+ unit_test[0],
+ unit_test[1],
+ dependencies: [
+ contrib_dep,
+ libkres_dep,
+ cmocka,
+ lmdb,
+ ],
)
-
- mock_cmodule_dep = declare_dependency(
- link_with: mock_cmodule_lib,
+ test(
+ 'unit.' + unit_test[0],
+ exec_test,
+ suite: 'unit',
)
-
- # executables with tests
- foreach unit_test : unit_tests
- exec_test = executable(
- 'unit.' + unit_test[0],
- unit_test[1],
- dependencies: [
- contrib_dep,
- libkres_dep,
- cmocka,
- lmdb,
- ],
- )
- test(
- unit_test[0],
- exec_test,
- suite: 'unit',
- )
- endforeach
-endif
+endforeach