From 80eb78d7a4ba70e81e32d2a7bd3d6b242da6c7bd Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2022 15:12:47 -0800 Subject: [PATCH] meson: use a feature option for shared-glapi Reviewed-by: Jesse Natalie Acked-by: Alyssa Rosenzweig Part-of: --- meson.build | 16 +++------------- meson_options.txt | 4 +--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index cf7b271c1e26c..c91c028f0ebe1 100644 --- a/meson.build +++ b/meson.build @@ -134,19 +134,9 @@ endif with_opengl = get_option('opengl') # Default shared glapi off for windows, on elsewhere. -_sg = get_option('shared-glapi') -if _sg == 'true' - _sg = 'enabled' - warning('shared-glapi option "true" deprecated, please use "enabled" instead.') -elif _sg == 'false' - _sg = 'disabled' - warning('shared-glapi option "false" deprecated, please use "disabled" instead.') -endif -if _sg == 'auto' - with_shared_glapi = host_machine.system() != 'windows' -else - with_shared_glapi = _sg == 'enabled' -endif +with_shared_glapi = get_option('shared-glapi') \ + .disable_auto_if(host_machine.system() == 'windows') \ + .allowed() # shared-glapi is required if at least two OpenGL APIs are being built if not with_shared_glapi diff --git a/meson_options.txt b/meson_options.txt index 9d0f2c9bff622..4bfb45953135a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -241,9 +241,7 @@ option( ) option( 'shared-glapi', - type : 'combo', - value : 'auto', - choices : ['auto', 'true', 'false', 'enabled', 'disabled'], + type : 'feature', description : 'Whether to build a shared or static glapi. Defaults to false on Windows, true elsewhere' ) option(