From 2fdc7debc78b91146b71a5f0c6595431ee67f02a Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Tue, 24 Sep 2024 09:12:03 +0200 Subject: [PATCH] Refactor meson handling of fuzz tools --- meson.build | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 0b426d1875..0fadd1be54 100644 --- a/meson.build +++ b/meson.build @@ -948,14 +948,21 @@ if get_option('unit-tests') endif if get_option('fuzz-targets') - tools += { - 'fuzz-target-moadnsparser' : { 'main': src_dir / 'fuzz_moadnsparser.cc' }, - 'fuzz-target-packetcache' : { 'main': src_dir / 'fuzz_packetcache.cc' }, - 'fuzz-target-proxyprotocol' : { 'main': src_dir / 'fuzz_proxyprotocol.cc' }, - 'fuzz-target-dnslabeltext-parseRFC1035CharString' : { 'main': src_dir / 'fuzz_dnslabeltext_parseRFC1035CharString.cc' }, - 'fuzz-target-yahttp' : { 'main': src_dir / 'fuzz_yahttp.cc' }, - 'fuzz-target-zoneparsertng' : { 'main': src_dir / 'fuzz_zoneparsertng.cc' }, - } + fuzz_targets = [ + 'moadnsparser', + 'packetcache', + 'proxyprotocol', + 'dnslabeltext-parseRFC1035CharString', + 'yahttp', + 'zoneparsertng', + ] + + foreach target: fuzz_targets + source_file = src_dir / 'fuzz_' + target.underscorify() + '.cc' + tools += { + 'fuzz-target-' + target: { 'main': source_file } + } + endforeach endif libpdns_common = declare_dependency( -- 2.47.2