summaryrefslogtreecommitdiffhomepage
path: root/src/Makefile
diff options
context:
space:
mode:
authorAntonis Geralis <[email protected]>2023-01-25 23:25:25 +0200
committerGitHub <[email protected]>2023-01-25 22:25:25 +0100
commit4adba0d3c3df93592346a592e7a2b79d5b76bd90 (patch)
treea284b2403530aa666b686f99665547048859b030 /src/Makefile
parent7cdffcec5274b1ea4505909bc01058091fe906c3 (diff)
downloadraylib-4adba0d3c3df93592346a592e7a2b79d5b76bd90.tar.gz
raylib-4adba0d3c3df93592346a592e7a2b79d5b76bd90.zip
Add wayland support (#2883)
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
index c2e227f7..4d9c8723 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -409,6 +409,24 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS), LINUX)
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
CFLAGS += -D_GLFW_WAYLAND
+ LDFLAGS += $(shell pkg-config wayland-client wayland-cursor wayland-egl xkbcommon --libs)
+
+ WL_PROTOCOLS_DIR := $(shell pkg-config wayland-protocols --variable=pkgdatadir)
+ WL_CLIENT_DIR := $(shell pkg-config wayland-client --variable=pkgdatadir)
+
+ wl_generate = \
+ $(eval protocol=$(1)) \
+ $(eval basename=$(2)) \
+ $(shell wayland-scanner client-header $(protocol) $(RAYLIB_SRC_PATH)/$(basename).h) \
+ $(shell wayland-scanner private-code $(protocol) $(RAYLIB_SRC_PATH)/$(basename)-code.h)
+
+ $(call wl_generate, $(WL_CLIENT_DIR)/wayland.xml, wayland-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml, wayland-xdg-shell-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml, wayland-xdg-decoration-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/stable/viewporter/viewporter.xml, wayland-viewporter-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml, wayland-relative-pointer-unstable-v1-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml, wayland-pointer-constraints-unstable-v1-client-protocol)
+ $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml, wayland-idle-inhibit-unstable-v1-client-protocol)
endif
endif
endif