Libepoxy currently depends on all headers living under the same prefix.
This is not necessarily true: X11 headers can live in a separate prefix,
for instance under /opt/X11. This is also the case when cross-compiling to
a platform that sets up the build environment in non-standard ways.
We could add `x11_dep` and `egl_dep` to the libepoxy target dependencies,
but that could potentially add spurious linker flags and cause libepoxy to
depend on libraries it will dlopen() during normal operations.
To avoid that case, we use a partial_dep() object from Meson, and we limit
the dependency to compiler flags and inclusion paths.
This maintains compatibility with previous behavior of
always using GLX_LIB if it is found. The only change is
when there is no GLX_LIB.
Previous behavior when no GLX_LIB:
- abort.
New behavior when no GLX_LIB:
- Try to load libOpenGL.so as gl_handle (glx_handle remains NULL).
- Else, abort.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Since we're generating stub types from khrplatform.h because we can't
include it reliably, we'll have to deal with some of the fallout of the
Win64 types.
Fixes: #246
GTK currently fails to detect if epoxy has been built with EGL on
Windows when epoxy is a subproject. To fix that it needs to get that
information from the dependency variables.
This requires Meson >=0.54.0 for setting variables in
declare_dependency().
Without additional check, even if libOpenGL was loaded, libGL.so will
be loaded as well, and used both in gl_handle and glx_handle, so
libglvnd libraries will not be used.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
Throughout the mesa project we've been using 100 for GLES2's shading
language. It was pretty clearly the intent here, but the clever
inline detection of "am I parsing a GLSL version or a GL version
string" forgot about GLSL 1.0.x, and thus returned 10.
Do not rely on the shebang line and the executable bit; we should use
find_program(), instead, which lets Meson run a script in the
appropriate environment, portably.