diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2022-06-10 10:31:37 +1000 |
---|---|---|
committer | José Expósito <jose.exposito89@gmail.com> | 2022-06-11 10:54:15 +0000 |
commit | 6a1bd5b0c9be55d21c6e066a94fc6fd77fea96ce (patch) | |
tree | 25886965e2f4bb128422b53e3154f18261e3266c /tools | |
parent | 35420239963747b0c10778a028c07ddf24e57146 (diff) |
meson.build: check gtk targets before building
We have two different dependencies on Wayland: GTK support and the
wayland-protocols we use directly. If we have GTK support but
wayland-protocols is not installed at meson configure time, our build
fails.
To avoid having multiple ifdefs in the code, let's define two new ones:
HAVE_GTK_WAYLAND and HAVE_GTK_X11, both set if GTK supports that
particular target (from pkgconfig) and we have the other support
libraries we need.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libinput-debug-gui.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/libinput-debug-gui.c b/tools/libinput-debug-gui.c index b8685c8c..309c0450 100644 --- a/tools/libinput-debug-gui.c +++ b/tools/libinput-debug-gui.c @@ -48,7 +48,7 @@ #include "shared.h" -#ifdef GDK_WINDOWING_WAYLAND +#if HAVE_GTK_WAYLAND #include <wayland-client.h> #include "pointer-constraints-unstable-v1-client-protocol.h" #if HAVE_GTK4 @@ -58,7 +58,7 @@ #endif #endif -#ifdef GDK_WINDOWING_X11 +#if HAVE_GTK_X11 #include <X11/X.h> #include <X11/Xlib.h> #if HAVE_GTK4 @@ -120,7 +120,7 @@ struct window { struct { bool locked; -#ifdef GDK_WINDOWING_WAYLAND +#if HAVE_GTK_WAYLAND struct zwp_pointer_constraints_v1 *wayland_pointer_constraints; struct zwp_locked_pointer_v1 *wayland_locked_pointer; #endif @@ -207,7 +207,7 @@ struct window { struct libinput_device *devices[50]; }; -#ifdef GDK_WINDOWING_WAYLAND +#if HAVE_GTK_WAYLAND static void wayland_registry_global(void *data, struct wl_registry *registry, @@ -297,9 +297,9 @@ backend_is_wayland(void) { return GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()); } -#endif /* GDK_WINDOWING_WAYLAND */ +#endif /* HAVE_GTK_WAYLAND */ -#ifdef GDK_WINDOWING_X11 +#if HAVE_GTK_X11 static bool x_lock_pointer(struct window *w) { @@ -342,19 +342,19 @@ backend_is_x11(void) { return GDK_IS_X11_DISPLAY(gdk_display_get_default()); } -#endif /* GDK_WINDOWING_X11 */ +#endif /* HAVE_GTK_X11 */ static bool window_lock_pointer(struct window *w) { w->lock_pointer.locked = false; -#ifdef GDK_WINDOWING_WAYLAND +#if HAVE_GTK_WAYLAND if (backend_is_wayland()) w->lock_pointer.locked = wayland_lock_pointer(w); #endif -#ifdef GDK_WINDOWING_X11 +#if HAVE_GTK_X11 if (backend_is_x11()) w->lock_pointer.locked = x_lock_pointer(w); #endif @@ -370,12 +370,12 @@ window_unlock_pointer(struct window *w) w->lock_pointer.locked = false; -#ifdef GDK_WINDOWING_WAYLAND +#if HAVE_GTK_WAYLAND if (backend_is_wayland()) wayland_unlock_pointer(w); #endif -#ifdef GDK_WINDOWING_X11 +#if HAVE_GTK_X11 if (backend_is_x11()) x_unlock_pointer(w); #endif |