From 6291d4d33978f14e59e64a4b66ef92ee891babc3 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 25 Jan 2023 18:44:33 +0000 Subject: [PATCH] meson: turn android-libbacktrace into a feature option Signed-off-by: Eric Engestrom Reviewed-by: Dylan Baker Part-of: --- .gitlab-ci/build/gitlab-ci.yml | 2 +- meson.build | 12 ++++-------- meson_options.txt | 4 +--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index baf8cb3776f..fc0f00677f6 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -345,7 +345,7 @@ debian-android: -D llvm=disabled -D platform-sdk-version=33 -D valgrind=disabled - -D android-libbacktrace=false + -D android-libbacktrace=disabled GALLIUM_ST: > -D dri3=disabled -D gallium-vdpau=disabled diff --git a/meson.build b/meson.build index 4ecdd523ed5..acabbcdfc88 100644 --- a/meson.build +++ b/meson.build @@ -818,14 +818,10 @@ if with_android_stub and not with_platform_android error('`-D android-stub=true` makes no sense without `-D platforms=android`') endif -if get_option('android-libbacktrace') == 'auto' - with_libbacktrace = with_platform_android -else - with_libbacktrace = get_option('android-libbacktrace') == 'true' - if with_libbacktrace and not with_platform_android - error('`-D android-libbacktrace=true` makes no sense without `-D platforms=android`') - endif -endif +with_libbacktrace = get_option('android-libbacktrace') \ + .require(with_platform_android, error_message : '`-D android-libbacktrace=enabled` makes no sense without `-D platforms=android`') \ + .disable_auto_if(not with_platform_android) \ + .allowed() if with_libbacktrace cpp_args += '-DWITH_LIBBACKTRACE' diff --git a/meson_options.txt b/meson_options.txt index d3b4c2fbaa4..27f6af7de53 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,9 +45,7 @@ option( ) option( 'android-libbacktrace', - type : 'combo', - value : 'auto', - choices : ['auto', 'true', 'false'], + type : 'feature', description : 'Use Android\'s libbacktrace', ) option(