diff options
author | Dylan Baker <dylan.c.baker@intel.com> | 2022-12-20 15:19:00 -0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-01-19 16:29:03 +0000 |
commit | 6b334a84167377a4b9dfe4836b13fa66d2850217 (patch) | |
tree | 0720f9b9f91c749af8329a866bc24fcf3270881a /meson.build | |
parent | ca615a4f16d3a2e1c5078aee7b83556a4121116a (diff) | |
download | mesa-6b334a84167377a4b9dfe4836b13fa66d2850217.tar.gz |
meson: use a feature option for gles2
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/meson.build b/meson.build index bdc6bd70a7b..2fc6140b793 100644 --- a/meson.build +++ b/meson.build @@ -107,51 +107,23 @@ if gbm_backends_path == '' gbm_backends_path = join_paths(get_option('prefix'), get_option('libdir'), 'gbm') endif -with_gles2 = get_option('gles2') -if with_gles2 == 'true' - with_gles2 = 'enabled' - warning('gles2 option "true" deprecated, please use "enabled" instead.') -elif with_gles2 == 'false' - with_gles2 = 'disabled' - warning('gles2 option "false" deprecated, please use "disabled" instead.') -endif -if host_machine.system() == 'windows' - if with_gles1 == 'auto' - with_gles1 = 'disabled' - endif - if with_gles2 == 'auto' - with_gles2 = 'disabled' - endif -endif -with_opengl = get_option('opengl') - # Default shared glapi off for windows, on elsewhere. with_shared_glapi = get_option('shared-glapi') \ .disable_auto_if(host_machine.system() == 'windows') \ .allowed() +with_opengl = get_option('opengl') + with_gles1 = get_option('gles1') \ .require(with_shared_glapi, error_message : 'OpengGL ES 1.x requires shared-glapi') \ .require(with_opengl, error_message : 'building OpenGL ES 1.x without OpenGL is not supported.') \ .allowed() -# shared-glapi is required if at least two OpenGL APIs are being built -if not with_shared_glapi - if with_gles2 == 'enabled' and not with_opengl - error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x') - endif - with_gles2 = 'disabled' -endif - -# We require OpenGL for OpenGL ES -if not with_opengl - if with_gles2 == 'enabled' and not with_opengl - error('building OpenGL ES without OpenGL is not supported.') - endif - with_gles2 = 'disabled' -endif +with_gles2 = get_option('gles2') \ + .require(with_shared_glapi, error_message : 'OpengGL ES 2.x requires shared-glapi') \ + .require(with_opengl, error_message : 'building OpenGL ES 2.x without OpenGL is not supported.') \ + .allowed() -with_gles2 = with_gles2 != 'disabled' with_any_opengl = with_opengl or with_gles1 or with_gles2 # Only build shared_glapi if at least one OpenGL API is enabled with_shared_glapi = with_shared_glapi and with_any_opengl |