From 868fbe622bcfb280d2d879088dc86187430ffbbd Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Sun, 11 Feb 2024 01:26:21 +0200 Subject: [PATCH] meson: Make libdisplay_info a feature option Some features depend on libdisplay-info, and making it a feature option should increase its visibility and adoption. This makes it required when building with "-Dauto_features=enabled", unless explicitly disabled with "-Dlibdisplay_info=disabled". If "-Dauto_features=enabled" is not set, everything remains the same. In the future, the libdisplay_info option can be made "enabled" by default so that it would always be required unless explicitly disabled. Part-of: --- .gitlab-ci.yml | 2 +- meson.build | 7 +++---- meson_options.txt | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bea48599d..460a9fdcd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -324,7 +324,7 @@ check-code-style: -Degl_device=true -Dwayland_eglstream=true -Dcatch=true - -Dlibdisplay_info=true + -Dlibdisplay_info=enabled .build-mutter: extends: diff --git a/meson.build b/meson.build index 73b4fb283..b36f81d6d 100644 --- a/meson.build +++ b/meson.build @@ -168,10 +168,9 @@ if have_x11_client xau_dep = dependency('xau') endif -have_libdisplay_info = get_option('libdisplay_info') -if have_libdisplay_info - libdisplay_info_dep = dependency('libdisplay-info') -endif +use_libdisplay_info = get_option('libdisplay_info') +libdisplay_info_dep = dependency('libdisplay-info', required: use_libdisplay_info) +have_libdisplay_info = libdisplay_info_dep.found() have_gnome_desktop = get_option('libgnome_desktop') if have_gnome_desktop diff --git a/meson_options.txt b/meson_options.txt index b5d215b24..158a3c101 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -226,7 +226,8 @@ option('catch', ) option('libdisplay_info', - type: 'boolean', - value: false, + type: 'feature', + value: 'auto', + deprecated: {'true': 'enabled', 'false': 'disabled'}, description: 'Build with or without libdisplay-info' )