[gtk/wip/master.win.egl: 342/344] build: Check for EGL support in libepoxy on Windows



commit 8cb6b7186529fa6a5e9b48747639b6fa52dc6d56
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jun 22 15:02:24 2018 +0800

    build: Check for EGL support in libepoxy on Windows
    
    ...EGL support needs to be explicitly enabled during the build of
    libepoxy on Windows as it is not enabled by default on Windows.
    
    With this, we can add an EGL renderer for Windows that make use of
    Google's libANGLE, which is a library that translates OpenGL/ES calls
    to Direct3D 9/11, which will provide better hardware compatibility
    on Windows and would act as one of the foundations to resolve issue #105.

 gdk/win32/meson.build |  8 +++++++-
 meson.build           | 16 ++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build
index 534772b495..9d13b91b0a 100644
--- a/gdk/win32/meson.build
+++ b/gdk/win32/meson.build
@@ -44,11 +44,17 @@ gdk_win32_public_headers = files([
 install_headers(gdk_win32_public_headers, subdir: 'gtk-4.0/gdk/win32/')
 install_headers('gdkwin32.h', subdir: 'gtk-4.0/gdk/')
 
+GDK_WIN32_EGL_CFLAGS = []
+
+if win32_has_egl
+  GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
+endif
+
 gdk_win32_deps = [ # FIXME
 ]
 
 libgdk_win32 = static_library('gdk-win32',
   gdk_win32_sources, gdkconfig, gdkenum_h,
   include_directories: [confinc, gdkinc],
-  c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'],
+  c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'] + GDK_WIN32_EGL_CFLAGS,
   dependencies: [gdk_deps, gdk_win32_deps])
diff --git a/meson.build b/meson.build
index 53504f9279..271631f9b1 100644
--- a/meson.build
+++ b/meson.build
@@ -582,6 +582,22 @@ if win32_enabled
   endif
   pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32']
   backend_immodules += ['ime']
+
+  # Check whether libepoxy is built with EGL support on Windows
+  win32_has_egl = cc.links(
+     '''
+     #include <epoxy/egl.h>
+        
+     int main(int argc, char *argv[])
+     {
+       EGLDisplay disp = EGL_NO_DISPLAY;
+
+       return epoxy_egl_version (disp);
+     } 
+     ''',
+     dependencies : epoxy_dep,
+     name : 'libepoxy supports EGL on Windows'
+    )
 endif
 
 # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]