build: Add a HAVE_EGL define to config.h
authorBenjamin Otte <otte@redhat.com>
Tue, 5 Oct 2021 02:14:57 +0000 (04:14 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 6 Oct 2021 01:43:47 +0000 (03:43 +0200)
gdk/win32/meson.build
meson.build

index 93c55fa6d88a9e799b8f8c2eafa9c0512e4ca9cf..0177adaf838a2ca25ae6339bc23bf392b0fc34e9 100644 (file)
@@ -48,7 +48,7 @@ install_headers(gdk_win32_public_headers, 'gdkwin32.h', subdir: 'gtk-4.0/gdk/win
 
 GDK_WIN32_EGL_CFLAGS = []
 
-if win32_has_egl
+if have_egl
   GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
   gdk_win32_sources += ['gdkglcontext-win32-egl.c']
 endif
index bea2015429a6f55cb856d458de2c3e2bf71da299..897de137661b66bc55c370d0ab6a0248dbd472dc 100644 (file)
@@ -481,7 +481,15 @@ if not cairo_csi_dep.found()
   cairo_csi_dep = cc.find_library('cairo-script-interpreter', required: get_option('build-tests'))
 endif
 
+have_egl = epoxy_dep.get_variable(
+  pkgconfig: 'epoxy_has_egl',
+  internal: 'epoxy_has_egl',
+  default_value: '0') == '1'
+
 cdata.set('HAVE_CAIRO_SCRIPT_INTERPRETER', cairo_csi_dep.found())
+if have_egl
+  cdata.set('HAVE_EGL', 1)
+endif
 cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found())
 cdata.set('HAVE_PANGOFT', pangoft_dep.found())
 
@@ -589,10 +597,6 @@ if win32_enabled
   pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32']
 
   # Check whether libepoxy is built with EGL support on Windows
-  win32_has_egl = epoxy_dep.get_variable(
-    pkgconfig: 'epoxy_has_egl',
-    internal: 'epoxy_has_egl',
-    default_value: '0') == '1'
 endif
 
 # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by