tree-wide: check if necessary cflags dependencies are set
This makes each `foo_cflags` dependency define a `SYSTEMD_CFLAGS_MARKER_FOO` macro, and checks if the macro is set when headers provided by external libraries are included. With this, we can fail fast at compile time if necessary `_cflags` dependencies are omitted in meson.build. Missing dependencies found by this mechanism have been added across the tree.
This commit is contained in:
@@ -5,12 +5,18 @@
|
||||
#include "macro.h"
|
||||
|
||||
#if HAVE_GLIB
|
||||
#ifndef SYSTEMD_CFLAGS_MARKER_LIBGLIB
|
||||
# error "missing libglib_cflags in meson dependency."
|
||||
#endif
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
#include <gio/gio.h> /* NOLINT */
|
||||
REENABLE_WARNING
|
||||
#endif
|
||||
|
||||
#if HAVE_DBUS
|
||||
#ifndef SYSTEMD_CFLAGS_MARKER_LIBDBUS
|
||||
# error "missing libdbus_cflags in meson dependency."
|
||||
#endif
|
||||
#include <dbus/dbus.h>
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user