]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: do not build fuzzers when fuzz-tests=false
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Nov 2020 06:22:07 +0000 (15:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Nov 2020 09:15:37 +0000 (18:15 +0900)
Closes #17578.

meson.build
test/fuzz/meson.build

index 43e328f5a6a7a3e71451baec2ab2c1faa9f501e5..0727fd55894d05232c56c242b5622a33480c39d2 100644 (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'],
index 772e07e7fc3853d5d791effbf3b82668a18062b7..7a83961d11cb5571c161d4d517a508bfd919e87a 100644 (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])