aboutsummaryrefslogtreecommitdiff
path: root/glgen.sh
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-04-21 00:35:57 +0000
committerSimon Ser <contact@emersion.fr>2019-04-22 00:04:08 +0300
commit95b22619e08adc3d407925c5eb4758dd9164c8fa (patch)
tree8d5de6e0f360ec581e13e42e76d7b3539096342a /glgen.sh
parent4207f05030a2fcf1903248730ffab6d14f627fbe (diff)
Fix missing headers when building without X11
The deleted includes are redundant, because other headers will include the necessary files. Additionally, they cause build failures, because including EGL/egl.h or EGL/eglext.h directly, instead of through wlr/render/egl.h or wlr/render/interface.h, will mean that MESA_EGL_NO_X11_HEADERS will not have been defined, and so the EGL headers will attempt to pull in unnecessary X11 headers that may not exist on the system. For the headers produced by glgen.sh, the includes couldn't simply be deleted, because no other header would include the EGL headers. Neither wlr/render/egl.h or wlr/render/interface.h felt appropriate to include, so I opted instead to copy the MESA_EGL_NO_X11_HEADERS definition before the EGL includes.
Diffstat (limited to 'glgen.sh')
-rwxr-xr-xglgen.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/glgen.sh b/glgen.sh
index fb3bb3c6..daa98b00 100755
--- a/glgen.sh
+++ b/glgen.sh
@@ -62,6 +62,11 @@ cat > "$OUTDIR/$BASE.h" << EOF
#define $INCLUDE_GUARD
#include <stdbool.h>
+#include <wlr/config.h>
+
+#if !WLR_HAS_X11_BACKEND && !WLR_HAS_XWAYLAND && !defined MESA_EGL_NO_X11_HEADERS
+#define MESA_EGL_NO_X11_HEADERS
+#endif
#include <EGL/egl.h>
#include <EGL/eglext.h>