fuzz: pass -Dc_args=/-Dcpp_args= to fuzzer targets
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 10 Nov 2023 15:38:01 +0000 (16:38 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 10 Nov 2023 17:22:08 +0000 (17:22 +0000)
commit17ee59c9c922553a8cb4d54cb8ae415706c4feff
tree3c77f534b6ecc9a8517c38a09ede99e0d67ed318
parentbe0916f77cb4ceb105edc6df92f41c3973b2e74e
fuzz: pass -Dc_args=/-Dcpp_args= to fuzzer targets

Prompted by #29972, because right now it's practically impossible to pass
-fno-sanitize=function to the fuzzer targets without some extensive
sed'ing.

This splits both c_args and cpp_args to separate arguments for
tools/meson-build.sh, because the other way would be to use `eval`, so
the space-separated but quoted strings passed to these options are not
split where they shouldn't, and I'd rather avoid using `eval` if
possible.

Also, this switches the positional arguments we pass to `meson setup`,
as they were in incorrect order (docs say it should be buildir followed
by sourcedir); meson is apparently clever enough to figure this out and
switch the arguments around if necessary, so it didn't complain.
test/fuzz/meson.build
tools/meson-build.sh