aboutsummaryrefslogtreecommitdiff
path: root/backend/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/backend.c')
-rw-r--r--backend/backend.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/backend.c b/backend/backend.c
index c67be617..52344dac 100644
--- a/backend/backend.c
+++ b/backend/backend.c
@@ -11,9 +11,14 @@
#include <wlr/backend/multi.h>
#include <wlr/backend/session.h>
#include <wlr/backend/wayland.h>
-#include <wlr/backend/x11.h>
+#include <wlr/config.h>
#include <wlr/util/log.h>
+/* WLR_HAS_X11_BACKEND needs to be after wlr/config.h */
+#ifdef WLR_HAS_X11_BACKEND
+#include <wlr/backend/x11.h>
+#endif
+
void wlr_backend_init(struct wlr_backend *backend,
const struct wlr_backend_impl *impl) {
assert(backend);
@@ -94,6 +99,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display) {
}
}
+#ifdef WLR_HAS_X11_BACKEND
const char *x11_display = getenv("DISPLAY");
if (x11_display) {
struct wlr_backend *x11_backend =
@@ -101,6 +107,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display) {
wlr_multi_backend_add(backend, x11_backend);
return backend;
}
+#endif
// Attempt DRM+libinput
struct wlr_session *session = wlr_session_create(display);