From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= 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 a3c61cf..c45614c 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 05aeb46..2e95ede 100644 --- a/meson.build +++ b/meson.build @@ -247,6 +247,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') @@ -608,6 +610,7 @@ summary('Wayland', have_wayland, section: 'Options') summary('Wayland EGLStream', have_wayland_eglstream, 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('gudev', have_libgudev, section: 'Options') diff --git a/meson_options.txt b/meson_options.txt index da75539..86e3c62 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,