From: Chris Hofer Date: Mon, 20 Apr 2026 14:55:38 +0000 (+0200) Subject: build: Compile fuzz-journald-util.c only if want_fuzz_tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85b5acde869baa51f5618fa503eafac3dccbf379;p=thirdparty%2Fsystemd.git build: Compile fuzz-journald-util.c only if want_fuzz_tests fuzz-journald-util.c is compiled unconditionally even though fuzzing tests aren't enabled. Only build it if fuzzing tests are configured. This also ensure that the functions it uses from src/shared/tests.c are available. Fixes 32bd43d768a4bdd54481c5e37ce9ea3d1009a824 Closes #39984 Signed-off-by: Chris Hofer --- diff --git a/src/journal/meson.build b/src/journal/meson.build index 5f643042194..1bec605b0cc 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -19,11 +19,16 @@ systemd_journald_extract_sources = files( 'journald-syslog.c', 'journald-varlink.c', 'journald-wall.c', - # Build fuzz-journald.c as part of systemd-journald so we only compile it once instead of once per - # fuzz test. - 'fuzz-journald-util.c', ) +if want_fuzz_tests + # Build fuzz-journald-util.c as part of systemd-journald so we only + # compile it once instead of once per fuzz test. + systemd_journald_extract_sources += files( + 'fuzz-journald-util.c', + ) +endif + journald_gperf_c = custom_target( input : 'journald-gperf.gperf', output : 'journald-gperf.c',