]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Refactor meson handling of fuzz tools 14703/head
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 24 Sep 2024 07:12:03 +0000 (09:12 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Tue, 24 Sep 2024 07:12:03 +0000 (09:12 +0200)
meson.build

index 0b426d1875cb2352fc991658287721e3fe7430d4..0fadd1be5484077485c728bd752dcf5e30f71396 100644 (file)
@@ -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(