meson: do not build fuzzers when fuzz-tests=false

Closes #17578.
This commit is contained in:
Yu Watanabe 2020-11-13 15:22:07 +09:00
parent e2357b1c8a
commit 1763ef1d49
2 changed files with 5 additions and 5 deletions

View File

@ -3438,7 +3438,7 @@ endif
fuzzer_exes = []
if get_option('tests') != 'false'
if fuzz_tests or fuzzer_build
foreach tuple : fuzzers
sources = tuple[0]
link_with = tuple[1].length() > 0 ? tuple[1] : [libshared]
@ -3560,7 +3560,7 @@ foreach tuple : sanitizers
if name != prev
if want_tests == 'false'
message('Not compiling @0@ because tests is set to false'.format(name))
elif slow_tests or fuzz_tests
elif fuzz_tests
exe = custom_target(
name,
output : name,
@ -3570,12 +3570,12 @@ foreach tuple : sanitizers
'@OUTPUT@'],
build_by_default : true)
else
message('Not compiling @0@ because slow-tests/fuzz-tests is set to false'.format(name))
message('Not compiling @0@ because fuzz-tests is set to false'.format(name))
endif
endif
prev = name
if want_tests != 'false' and (slow_tests or fuzz_tests)
if fuzz_tests
test('@0@:@1@:@2@'.format(b, c, sanitizer),
env,
env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],

View File

@ -15,7 +15,7 @@ sanitize_address_undefined = custom_target(
project_source_root,
'@OUTPUT@',
'fuzzers',
'-Db_lundef=false -Db_sanitize=address,undefined @0@'.format(optimization),
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined @0@'.format(optimization),
' '.join(cc.cmd_array()),
cxx_cmd])