From 71dcab0cc9accb322771fa8587241ee63fb76dd0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 14 Aug 2021 14:56:42 +0100 Subject: [PATCH 1/5] Post-release version bump to 1.5.10 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 93b9c1a..e0228d1 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.9', +project('libepoxy', 'c', version: '1.5.10', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', From a07b9b33832df2261ace6b84e6a041d14e390a75 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 12 Oct 2021 02:41:41 +0900 Subject: [PATCH 2/5] meson: Fix for building on non-English locale Specify utf-8 encoding to fix building on non-English locale --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index e0228d1..182a3c9 100644 --- a/meson.build +++ b/meson.build @@ -95,6 +95,7 @@ if cc.get_id() == 'msvc' '-we4053', # an expression of type void was used as an operand '-we4071', # no function prototype given '-we4819', # the file contains a character that cannot be represented in the current code page + '/utf-8', # Set the input and exec encoding to utf-8, like is the default with GCC ] elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' test_cflags = [ From 063c1df27974f58b0f3c0a57417732da068923cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 20 Oct 2021 10:59:09 +0100 Subject: [PATCH 3/5] fix error: use of undeclared identifier 'OPENGL_LIB' at epoxy/src/dispatch_common.c:690 in LibreOffice android build with libepoxy-1.5.9 --- src/dispatch_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 592df38..153eb7c 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -683,7 +683,11 @@ epoxy_load_gl(void) #endif if (!api.gl_handle) { +#if defined(OPENGL_LIB) fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB); +#else + fprintf(stderr, "Couldn't open %s\n", GLX_LIB); +#endif abort(); } From 9bf47884554b4f7e93c7c8fe4f51058a2efbb846 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 6 Oct 2021 09:44:12 +0100 Subject: [PATCH 4/5] Add the right include paths for EGL and X11 headers 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. --- meson.build | 2 ++ src/meson.build | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/meson.build b/meson.build index e0228d1..f3ae23f 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,11 @@ endif dl_dep = cc.find_library('dl', required: false) gl_dep = dependency('gl', required: false) egl_dep = dependency('egl', required: false) +elg_headers_dep = egl_dep.partial_dependency(compile_args: true, includes: true) # Optional dependencies for tests x11_dep = dependency('x11', required: false) +x11_headers_dep = x11_dep.partial_dependency(compile_args: true, includes: true) # GLES v2 and v1 may have pkg-config files, courtesy of downstream # packagers; let's check those first, and fall back to find_library() diff --git a/src/meson.build b/src/meson.build index 37e28f0..e19a918 100644 --- a/src/meson.build +++ b/src/meson.build @@ -59,6 +59,12 @@ epoxy_deps = [ dl_dep, ] if host_system == 'windows' epoxy_deps += [ opengl32_dep, gdi32_dep ] endif +if enable_x11 + epoxy_deps += [ x11_headers_dep, ] +endif +if build_egl + epoxy_deps += [ elg_headers_dep, ] +endif libepoxy = library( 'epoxy', From 8611b075ec8428d45f54cc58273f5330f842cbb0 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Wed, 8 Dec 2021 15:24:55 +0900 Subject: [PATCH 5/5] Improve library detections Now it automatically finds files from Qt 5 and supports the upstream ANGLE on Windows and macOS. --- meson.build | 36 +++++++++++++++++++++++++++++------- src/dispatch_common.c | 5 +++-- src/dispatch_common.h | 2 +- src/meson.build | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index e1d8d8b..cb21faf 100644 --- a/meson.build +++ b/meson.build @@ -165,25 +165,47 @@ endif # Dependencies dl_dep = cc.find_library('dl', required: false) gl_dep = dependency('gl', required: false) -egl_dep = dependency('egl', required: false) -elg_headers_dep = egl_dep.partial_dependency(compile_args: true, includes: true) # Optional dependencies for tests x11_dep = dependency('x11', required: false) x11_headers_dep = x11_dep.partial_dependency(compile_args: true, includes: true) -# GLES v2 and v1 may have pkg-config files, courtesy of downstream -# packagers; let's check those first, and fall back to find_library() -# if we fail +# We have multiple checks for EGL and GLES v2/v1 to support different providers: +# 1. pkg-config for Mesa +# 2. find_library() for ANGLE, which do not support pkg-config nor CMake. +# Note that Microsoft's "link" requires "lib" prefix. +# 3. CMake for Qt 5, which bundles ANGLE. +egl_dep = dependency('egl', required: false) +if not egl_dep.found() + egl_dep = cc.find_library('EGL', required: false) +endif +if not egl_dep.found() + egl_dep = cc.find_library('libEGL.dll', required: false) +endif +if not egl_dep.found() + egl_dep = dependency('Qt5Gui', modules: 'Qt5::Gui_EGL', required: false) +endif + gles2_dep = dependency('glesv2', required: false) if not gles2_dep.found() - gles2_dep = cc.find_library('libGLESv2', required: false) + gles2_dep = cc.find_library('GLESv2', required: false) +endif +if not gles2_dep.found() + gles2_dep = cc.find_library('libGLESv2.dll', required: false) +endif +if not gles2_dep.found() + egl_dep = dependency('Qt5Gui', modules: 'Qt5::Gui_GLESv2', required: false) endif gles1_dep = dependency('glesv1_cm', required: false) if not gles1_dep.found() - gles1_dep = cc.find_library('libGLESv1_CM', required: false) + gles1_dep = cc.find_library('GLESv1_CM', required: false) endif +if not gles1_dep.found() + gles1_dep = cc.find_library('libGLESv1_CM.dll', required: false) +endif + +elg_headers_dep = egl_dep.partial_dependency(compile_args: true, includes: true) # On windows, the DLL has to have all of its functions # resolved at link time, so we have to link directly against diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 153eb7c..5841a7e 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -175,9 +175,10 @@ #if defined(__APPLE__) #define GLX_LIB "/opt/X11/lib/libGL.1.dylib" +#define EGL_LIB "libEGL.dylib" #define OPENGL_LIB "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" -#define GLES1_LIB "libGLESv1_CM.so" -#define GLES2_LIB "libGLESv2.so" +#define GLES1_LIB "libGLESv1_CM.dylib" +#define GLES2_LIB "libGLESv2.dylib" #elif defined(__ANDROID__) #define GLX_LIB "libGLESv2.so" #define EGL_LIB "libEGL.so" diff --git a/src/dispatch_common.h b/src/dispatch_common.h index a136943..55388a8 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -28,7 +28,7 @@ #define PLATFORM_HAS_GLX ENABLE_GLX #define PLATFORM_HAS_WGL 1 #elif defined(__APPLE__) -#define PLATFORM_HAS_EGL 0 +#define PLATFORM_HAS_EGL ENABLE_EGL #define PLATFORM_HAS_GLX ENABLE_GLX #define PLATFORM_HAS_WGL 0 #elif defined(ANDROID) diff --git a/src/meson.build b/src/meson.build index e19a918..457a811 100644 --- a/src/meson.build +++ b/src/meson.build @@ -55,7 +55,7 @@ endif # Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108 darwin_versions = [1, '1.0'] -epoxy_deps = [ dl_dep, ] +epoxy_deps = [ dl_dep, egl_dep ] if host_system == 'windows' epoxy_deps += [ opengl32_dep, gdi32_dep ] endif