Skip to content

Commit 5d24c2a

Browse files
authored
Merge pull request #18 from rgacogne/dnsdist-rm-autotool
dnsdist: Simplify handling of fuzzing targets
2 parents 74cfcd1 + ed08d86 commit 5d24c2a

1 file changed

Lines changed: 25 additions & 32 deletions

File tree

pdns/dnsdistdist/meson.build

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,6 @@ tools = {
479479
},
480480
}
481481

482-
fuzz_targets = []
483-
484482
if get_option('fuzz-targets')
485483
fuzz_extra_sources = []
486484
fuzzer_ldflags = []
@@ -497,10 +495,10 @@ if get_option('fuzz-targets')
497495
'files-extra': fuzz_extra_sources,
498496
'deps-extra': [
499497
dep_libsystemd,
500-
]
498+
],
499+
'fuzzing-target': true,
501500
},
502501
}
503-
fuzz_targets += 'fuzz-target-dnsdistcache'.underscorify()
504502
if get_option('xsk').allowed() and dep_libbpf.found() and dep_libxdp.found()
505503
tools += {
506504
'fuzz-target-xsk' : {
@@ -513,12 +511,12 @@ if get_option('fuzz-targets')
513511
src_dir / 'misc.cc',
514512
src_dir / 'xsk.cc'
515513
],
516-
'deps-extra': [
514+
'deps-extra': [
517515
dep_libsystemd,
518-
]
516+
],
517+
'fuzzing-target': true,
519518
},
520519
}
521-
fuzz_targets += 'fuzz-target-xsk'.underscorify()
522520
endif
523521
endif
524522

@@ -640,6 +638,7 @@ if get_option('benchmark')
640638
endif
641639

642640
man_pages = []
641+
fuzzing_binaries = []
643642
foreach tool, info: tools
644643
var_name = tool.underscorify()
645644
main = files(info['main'])
@@ -650,42 +649,36 @@ foreach tool, info: tools
650649
link_args = 'link-args' in info ? info['link-args'] : []
651650
install = 'install' in info ? info['install'] : false
652651

652+
new_binary = executable(
653+
tool,
654+
main,
655+
config_h,
656+
files_extra,
657+
export_dynamic: export_dynamic,
658+
link_args: link_args,
659+
dependencies: [
660+
libdnsdist_common,
661+
deps_extra,
662+
],
663+
install: install,
664+
)
653665
set_variable(
654666
var_name,
655-
executable(
656-
tool,
657-
main,
658-
config_h,
659-
files_extra,
660-
export_dynamic: export_dynamic,
661-
link_args: link_args,
662-
dependencies: [
663-
libdnsdist_common,
664-
deps_extra,
665-
],
666-
install: install,
667-
)
667+
new_binary,
668668
)
669669

670670
if 'manpages' in info
671671
foreach man_page: info['manpages']
672672
man_pages += docs_dir / 'manpages' / (man_page + '.rst')
673673
endforeach
674674
endif
675+
if 'fuzzing-target' in info
676+
fuzzing_binaries += new_binary
677+
endif
675678
endforeach
676679

677-
if get_option('fuzz-targets')
678-
real_fuzz_targets = []
679-
foreach name : fuzz_targets
680-
real_fuzz_targets += get_variable(name)
681-
endforeach
682-
custom_target('fuzz-targets',
683-
command: ['/bin/true'],
684-
output: 'fuzz-targets',
685-
build_always_stale: true,
686-
depends: real_fuzz_targets
687-
)
688-
endif
680+
alias_target('fuzz-targets',
681+
fuzzing_binaries)
689682

690683
if get_option('unit-tests')
691684
test('testrunner', testrunner)

0 commit comments

Comments
 (0)