~eliasnaur/gio

a3101c9454b7451c0e3959820d6d2e1b409d2e63 — Elias Naur 18 days ago 56c3ede
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 <mail@eliasnaur.com>
2 files changed, 2 insertions(+), 1 deletions(-)

M app/internal/egl/egl_unix.go
M app/internal/window/egl_wayland.go
M app/internal/egl/egl_unix.go => app/internal/egl/egl_unix.go +1 -0
@@ 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 <EGL/egl.h>
#include <EGL/eglext.h>

M app/internal/window/egl_wayland.go => app/internal/window/egl_wayland.go +1 -1
@@ 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 <EGL/egl.h>
#include <wayland-client.h>