summaryrefslogtreecommitdiff
path: root/src/test/meson.build
diff options
context:
space:
mode:
authorTorsten Hilbrich <torsten.hilbrich@secunet.com>2022-11-07 08:38:58 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-11-07 22:00:42 +0900
commit41cac2a8b98fc5faebe942c697b17e109822342d (patch)
tree37c108edfdfbd476952099855db26c3bcf3e6c46 /src/test/meson.build
parentaaa411b9f4600b3ca7254ec56de29843c453dc2c (diff)
downloadsystemd-41cac2a8b98fc5faebe942c697b17e109822342d.tar.gz
test: compile test-utmp.c only if UTMP is enabled
When compiling with -D utmp=false the compilation fails with: ../../git/systemd/src/test/test-utmp.c: In function ‘test_dump_run_utmp’: ../../git/systemd/src/test/test-utmp.c:21:9: error: cleanup argument not a function 21 | _unused_ _cleanup_(utxent_cleanup) bool utmpx = false; | ^~~~~~~~ ../../git/systemd/src/test/test-utmp.c:23:17: error: implicit declaration of function ‘utxent_start’ [-Werror=implicit-function-declaration] 23 | utmpx = utxent_start(); | ^~~~~~~~~~~~ any many other errors Add a conditional to compile test-utmp.c only if ENABLE_UTMP is true.
Diffstat (limited to 'src/test/meson.build')
-rw-r--r--src/test/meson.build3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/meson.build b/src/test/meson.build
index 86fc1d4fc0..2a4dfe26db 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -622,7 +622,8 @@ tests += [
[files('test-journal-importer.c')],
- [files('test-utmp.c')],
+ [files('test-utmp.c'),
+ [], [], [], 'ENABLE_UTMP'],
[files('test-udev.c'),
[libudevd_core,