]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build: Compile fuzz-journald-util.c only if want_fuzz_tests
authorChris Hofer <christian.hofer@codasip.com>
Mon, 20 Apr 2026 14:55:38 +0000 (16:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Apr 2026 14:29:18 +0000 (16:29 +0200)
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 <christian.hofer@codasip.com>
src/journal/meson.build

index 5f643042194478208bda73813b2cc3308c9fc36e..1bec605b0ccf09a1f3df12e58c706c88e5ffad58 100644 (file)
@@ -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',