From a3101c9454b7451c0e3959820d6d2e1b409d2e63 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 20 Mar 2020 20:58:17 +0100 Subject: [PATCH] app/internal/window,app/internal/egl: avoid X11 dependency in EGL EGL is window system agnostic, but its egl.h header includex X11 headers by default. Use the MESA_EGL_NO_X11_HEADERS define to avoid it, fixing the "nox11" build for systems without X11 headers installed. Fixes #91 Signed-off-by: Elias Naur --- app/internal/egl/egl_unix.go | 1 + app/internal/window/egl_wayland.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/internal/egl/egl_unix.go b/app/internal/egl/egl_unix.go index 1eba3d49..e23660ff 100644 --- a/app/internal/egl/egl_unix.go +++ b/app/internal/egl/egl_unix.go @@ -10,6 +10,7 @@ package egl #cgo freebsd LDFLAGS: -L/usr/local/lib #cgo openbsd CFLAGS: -I/usr/X11R6/include #cgo openbsd LDFLAGS: -L/usr/X11R6/lib +#cgo CFLAGS: -DMESA_EGL_NO_X11_HEADERS #include #include diff --git a/app/internal/window/egl_wayland.go b/app/internal/window/egl_wayland.go index b7bc32bb..c4115fb5 100644 --- a/app/internal/window/egl_wayland.go +++ b/app/internal/window/egl_wayland.go @@ -13,7 +13,7 @@ import ( /* #cgo LDFLAGS: -lwayland-egl -#cgo CFLAGS: -I/usr/include/wayland +#cgo CFLAGS: -I/usr/include/wayland -DMESA_EGL_NO_X11_HEADERS #include #include