Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > 56cd83caed352de45a9af5b5169cd3a2 > files > 6

mutter-44.2-1.mga9.src.rpm

From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 16 Jan 2019 13:08:47 +0100
Subject: meson: add back default_driver option

In autotools it was possible to pass the --with-default-driver option
to force the usage of a specific cogl driver at build time.

Expose this functionality in meson as well

Origin: https://gitlab.gnome.org/GNOME/mutter/merge_requests/392
Forwarded: yes
Applied-upstream: no
---
 cogl/cogl-config.h.meson | 3 +++
 cogl/meson.build         | 4 ++++
 meson.build              | 3 +++
 meson_options.txt        | 6 ++++++
 4 files changed, 16 insertions(+)

diff --git a/cogl/cogl-config.h.meson b/cogl/cogl-config.h.meson
index 29ca429..85fd0c6 100644
--- a/cogl/cogl-config.h.meson
+++ b/cogl/cogl-config.h.meson
@@ -10,4 +10,7 @@
 /* Enable unit tests */
 #mesondefine ENABLE_UNIT_TESTS
 
+/* Default COGL driver */
+#mesondefine COGL_DEFAULT_DRIVER
+
 #define COGL_CONFIG_H_INCLUDED 1
diff --git a/cogl/meson.build b/cogl/meson.build
index a87cd18..6a60648 100644
--- a/cogl/meson.build
+++ b/cogl/meson.build
@@ -10,6 +10,10 @@ cdata.set('HAVE_COGL_GLES2', have_gles2)
 cdata.set('HAVE_TRACING', have_profiler)
 cdata.set('ENABLE_UNIT_TESTS', have_cogl_tests)
 
+if default_driver != 'auto'
+  cdata.set_quoted('COGL_DEFAULT_DRIVER', default_driver)
+endif
+
 cogl_config_h = configure_file(
   input: 'cogl-config.h.meson',
   output: 'cogl-config.h',
diff --git a/meson.build b/meson.build
index d3c2aea..3390bf0 100644
--- a/meson.build
+++ b/meson.build
@@ -268,6 +268,8 @@ if have_wayland_eglstream
   endif
 endif
 
+default_driver = get_option('default_driver')
+
 have_sm = get_option('sm')
 if have_sm
   sm_dep = dependency('sm')
@@ -661,6 +663,7 @@ summary('X11', have_x11, section: 'Options')
 summary('XWayland', have_xwayland, section: 'Options')
 summary('Native Backend', have_native_backend, section: 'Options')
 summary('EGL Device', have_egl_device, section: 'Options')
+summary('Default driver', default_driver, section: 'Options')
 summary('Remote desktop', have_remote_desktop, section: 'Options')
 summary('libgnome-desktop', have_gnome_desktop, section: 'Options')
 summary('Sound player', have_sound_player, section: 'Options')
diff --git a/meson_options.txt b/meson_options.txt
index cddcc1a..674d30e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,6 +75,12 @@ option('wayland_eglstream',
   description: 'Enable Wayland EGLStream support client support'
 )
 
+option('default_driver',
+  type: 'combo',
+  choices: ['auto', 'gl', 'gl3', 'gles2', 'nop'],
+  value: 'auto'
+)
+
 option('udev',
   type: 'boolean',
   value: true,