From 6218c5d576481e6a95d9f2722c069ddee1847bff Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Thu, 17 Oct 2024 12:56:33 -0600 Subject: [PATCH] Fix: Wayland compilation --- Makefile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f19225f..8a0283b 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,17 @@ CFLAGS = \ -I./ext/glfw/include \ -Wall -Wno-unused-function -std=c99 \ +WAYLAND-LIB = \ + xdg-shell \ + relative-pointer-unstable-v1 \ + xdg-decoration-unstable-v1 \ + pointer-constraints-unstable-v1 \ + viewporter \ + idle-inhibit-unstable-v1 \ + fractional-scale-v1 \ + xdg-activation-v1 \ + wayland + help: @echo "Para compilar el proyecto a tu sistema operativo" @echo "porfavor usa uno de los siguientes comandos:" @@ -51,13 +62,19 @@ cocoa: $(OBJ) $(MAKE) BKN=_GLFW_COCOA libglfw.so $(CC) -framework OpenGL -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -libglfw.so: - $(CC) -fPIC -shared -D$(BKN) -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o $@ +libglfw.so: wayland.h + $(CC) -fPIC -shared -D$(BKN) -D_GLFW_BUILD_DLL -Iext/glfw/deps/wayland ./ext/glfw/src/*.c -o $@ + +wayland.h: + for i in $(WAYLAND-LIB); do \ + wayland-scanner client-header ext/glfw/deps/wayland/$$i.xml ext/glfw/deps/wayland/$$i-client-protocol.h; \ + wayland-scanner private-code ext/glfw/deps/wayland/$$i.xml ext/glfw/deps/wayland/$$i-client-protocol-code.h; \ + done clean: rm $(OBJ) $(BIN) -.SUFFIXES: .c .o +.SUFFIXES: .c .o .c.o: $(CC) $(CFLAGS) -c -o $@ $<