subdir('meson/auth-tools') # Tools
subdir('meson/ixfrdist') # Ixfrdist
subdir('meson/systemd') # Systemd and unit file handling
-# TODO Use meson's -Db_coverage option?
-# subdir('meson/code-coverage') # Code coverage
+subdir('meson/code-coverage') # Code coverage
subdir('meson/auto-var-init') # Automatic Variable Initialization
# TODO Use meson's -Db_sanitize option?
# subdir('meson/sanitizers') # Sanitizers
# Code coverage
-code_coverage = get_option('code-coverage')
+coverage = get_option('b_coverage')
-if code_coverage
- args = ['-U_FORTIFY_SOURCE', '-g', '-O0', '-fprofile-arcs', '-ftest-coverage']
+if coverage
+ if get_option('buildtype') != 'debug'
+ warning('Coverage is enabled, using `builtype=debug` would produce better reports')
+ endif
- foreach arg: args
- if not cxx.has_argument(arg)
- error('Compiler does not support ' + arg + ', which is needed for code coverage')
- break
- endif
- endforeach
-
- add_global_arguments(args, language: ['cpp'])
+ if cxx.has_argument('-U_FORTIFY_SOURCE')
+ add_global_arguments('-U_FORTIFY_SOURCE', language: ['c', 'cpp'])
+ endif
endif
-summary('Code Coverage', code_coverage, bool_yn: true, section: 'Configuration')
+summary('Code Coverage', coverage, bool_yn: true, section: 'Configuration')
option('lua-records', type: 'boolean', value: true, description: 'Support Lua records')
option('systemd-service-user', type: 'string', value: 'pdns', description: 'Systemd service user (setuid and unit file; user is not created)')
option('systemd-service-group', type: 'string', value: 'pdns', description: 'Systemd service group (setgid and unit file; group is not created)')
-# TODO Use meson's -Db_coverage option?
-# option('code-coverage', type: 'boolean', value: false, description: 'Enable code coverage')
option('auto-var-init', type: 'combo', value: 'disabled', choices: ['zero', 'pattern', 'disabled'], description: 'Enable initialization of automatic variables')
# TODO Use meson's -Db_sanitize option?
# option('sanitizer-address', type: 'boolean', value: false, description: 'Enable the Address Sanitizer')