From 2b69a68ae3f6a3f63fe6166677fa8e8b15471c1b Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 2 Feb 2021 17:47:01 +0900 Subject: [PATCH] Support ANGLE on macOS --- meson.build | 7 +++++-- src/dispatch_common.c | 5 +++-- src/dispatch_common.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 93b9c1a..1132412 100644 --- a/meson.build +++ b/meson.build @@ -165,6 +165,9 @@ endif dl_dep = cc.find_library('dl', required: false) gl_dep = dependency('gl', required: false) egl_dep = dependency('egl', required: false) +if not egl_dep.found() + egl_dep = cc.find_library('EGL', required: false) +endif # Optional dependencies for tests x11_dep = dependency('x11', required: false) @@ -174,12 +177,12 @@ x11_dep = dependency('x11', required: false) # if we fail 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 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 # On windows, the DLL has to have all of its functions diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 592df38..a97ee33 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)