aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-07-13 11:02:37 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-07-13 11:02:37 +0100
commitf357024377435d2b2343f283b900979c307d6a36 (patch)
treeda7d98a789ef59af7bb8b47e252a7d5803071c10
parent81ae6d8bc64651e717c2a9c2cfc1a3099d0945b7 (diff)
downloadimv-f357024377435d2b2343f283b900979c307d6a36.tar.gz
Make window system configurable
-rw-r--r--Makefile10
-rw-r--r--config.mk7
-rw-r--r--src/wl_window.c (renamed from src/window.c)0
3 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f157e87..e690e8b 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ INSTALL_PROGRAM ?= install -m 0755
override CFLAGS += -std=c99 -W -Wall -Wpedantic -Wextra $(shell pkg-config --cflags pangocairo)
override CPPFLAGS += -D_XOPEN_SOURCE=700
-override LIBS := -lwayland-client -lwayland-egl -lEGL -lGL -lpthread -lxkbcommon $(shell pkg-config --libs pangocairo)
+override LIBS := -lGL -lpthread -lxkbcommon $(shell pkg-config --libs pangocairo)
BUILDDIR ?= build
TARGET := $(BUILDDIR)/imv
@@ -34,8 +34,12 @@ SOURCES += src/list.c
SOURCES += src/log.c
SOURCES += src/navigator.c
SOURCES += src/viewport.c
-SOURCES += src/window.c
-SOURCES += src/xdg-shell-protocol.c
+
+ifeq ($(WINDOWS),wayland)
+ SOURCES += src/wl_window.c
+ SOURCES += src/xdg-shell-protocol.c
+ override LIBS += -lwayland-client -lwayland-egl -lEGL
+endif
# Add backends to build as configured
ifeq ($(BACKEND_FREEIMAGE),yes)
diff --git a/config.mk b/config.mk
index bd4c5d2..c5fe837 100644
--- a/config.mk
+++ b/config.mk
@@ -1,3 +1,10 @@
+# Configure window system to use
+
+#Choices:
+# wayland - Use wayland backend
+# x11 - Use X11 backend
+WINDOWS=wayland
+
# Configure available backends:
# FreeImage http://freeimage.sourceforge.net
diff --git a/src/window.c b/src/wl_window.c
index 8393fa8..8393fa8 100644
--- a/src/window.c
+++ b/src/wl_window.c