meson: set only sanitizers for fuzzer when unspecified

That is when meson option b_sanitize is not used
This commit is contained in:
Philippe Antoine 2021-05-23 20:34:39 +02:00 committed by Max Kellermann
parent 62fc4d5cf4
commit d3a680cc87
1 changed files with 4 additions and 1 deletions

View File

@ -118,7 +118,10 @@ if get_option('buildtype') != 'debug'
endif endif
if get_option('fuzzer') if get_option('fuzzer')
fuzzer_flags = ['-fsanitize=fuzzer,address,undefined'] fuzzer_flags = ['-fsanitize=fuzzer']
if get_option('b_sanitize') == 'none'
fuzzer_flags += ['-fsanitize=address,undefined']
endif
add_global_arguments(fuzzer_flags, language: 'cpp') add_global_arguments(fuzzer_flags, language: 'cpp')
add_global_arguments(fuzzer_flags, language: 'c') add_global_arguments(fuzzer_flags, language: 'c')
add_global_link_arguments(fuzzer_flags, language: 'cpp') add_global_link_arguments(fuzzer_flags, language: 'cpp')