subdir('meson/auth-tools') # Tools
subdir('meson/ixfrdist') # Ixfrdist
subdir('meson/systemd') # Systemd and unit file handling
+subdir('meson/code-coverage') # Code coverage
# Find or generate pdns/dnslabeltext.cc
if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
--- /dev/null
+# Code coverage
+# Inputs: deps
+
+code_coverage_deps = []
+code_coverage = get_option('code-coverage')
+
+if code_coverage
+ args = ['-U_FORTIFY_SOURCE', '-g', '-O0', '-fprofile-arcs', '-ftest-coverage']
+
+ foreach arg: args
+ if not cxx.has_argument(arg)
+ error('Compiler does not support ' + arg + ', which is needed for code coverage')
+ break
+ endif
+
+ code_coverage_deps += declare_dependency(compile_args: [arg])
+ endforeach
+endif
+
+summary('Code Coverage', code_coverage, bool_yn: true, section: 'Configuration')
option('lua-records', type: 'boolean', value: true, description: 'Build support for Lua records')
option('systemd-service-user', type: 'string', value: 'pdns', description: 'User to run the systemd pdns service as. Only the setuid setting and User field in the systemd unit file are affected, the user is not created')
option('systemd-service-group', type: 'string', value: 'pdns', description: 'Group to run the systemd pdns service under. Only the setgid setting and Group field in the systemd unit file are affected, the group is not created')
+option('code-coverage', type: 'boolean', value: false, description: 'Enable code coverage')