Explicitly require systemd for systemd journal plugin. (#17313)
Without this change, it doesn’t fail until the build itself if the plugin is enabled but systemd could not be found.
Austin S. Hemmelgarn committed
Apr 17, 2024 at 07:03 UTC
ca6b72c06ae731d30567ef63d6b033619c6f03f1
1 file changed
+4
CMakeLists.txt
+4
@@ -1842,6 +1842,10 @@ if(ENABLE_PLUGIN_CGROUP_NETWORK)
1842
endif()
1843
1844
if(ENABLE_PLUGIN_SYSTEMD_JOURNAL)
1845
+ if(NOT SYSTEMD_FOUND)
1846
+ message(FATAL_ERROR "Systemd journal plugin requires systemd, but systemd was not found.")
1847
+ endif()
1848
+
1849
add_executable(systemd-journal.plugin ${SYSTEMD_JOURNAL_PLUGIN_FILES})
1850
target_link_libraries(systemd-journal.plugin libnetdata)
1851