[gnome-shell] build: Stop detecting features automatically
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] build: Stop detecting features automatically
- Date: Thu, 30 Nov 2017 12:30:41 +0000 (UTC)
commit ca367e4e26f6e25e232d456e00998366b5f06ea0
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Nov 25 07:15:39 2017 +0100
build: Stop detecting features automatically
Auto-detect options add some convenience for platforms where a
particular feature isn't available - systemd on non-Linux OS comes
to mind - but the downside is that it is easy to accidentally build
without a desired feature. We consider the latter much more serious
nowadays, so turn our auto-detect options into regular boolean
options.
https://bugzilla.gnome.org/show_bug.cgi?id=791007
meson.build | 34 +++++++---------------------------
meson_options.txt | 10 ++++------
2 files changed, 11 insertions(+), 33 deletions(-)
---
diff --git a/meson.build b/meson.build
index b0b6e9b..988fcb7 100644
--- a/meson.build
+++ b/meson.build
@@ -102,39 +102,19 @@ if enable_recorder
endif
nm_deps = []
-enable_networkmanager = get_option('networkmanager')
-if enable_networkmanager != 'no'
- want_networkmanager = enable_networkmanager == 'yes'
-
- nm_deps += dependency('libnm-glib',
- version: nm_req, required: want_networkmanager
- )
- nm_deps += dependency('libnm-util',
- version: nm_req, required: want_networkmanager
- )
- nm_deps += dependency('libnm-gtk',
- version: nm_req, required: want_networkmanager
- )
- nm_deps += dependency('libsecret-1',
- version: secret_req, required: want_networkmanager
- )
+if get_option('networkmanager')
+ nm_deps += dependency('libnm-glib', version: nm_req)
+ nm_deps += dependency('libnm-util', version: nm_req)
+ nm_deps += dependency('libnm-gtk', version: nm_req)
+ nm_deps += dependency('libsecret-1', version: secret_req)
have_networkmanager = true
- foreach dep : nm_deps
- have_networkmanager = have_networkmanager and dep.found()
- endforeach
-
- if not have_networkmanager
- nm_deps = []
- endif
else
have_networkmanager = false
endif
-enable_systemd = get_option('systemd')
-if enable_systemd != 'no'
- want_systemd = enable_systemd == 'yes'
- systemd_dep = dependency('libsystemd', required: want_systemd)
+if get_option('systemd')
+ systemd_dep = dependency('libsystemd')
have_systemd = systemd_dep.found()
else
systemd_dep = []
diff --git a/meson_options.txt b/meson_options.txt
index c6a9e55..65188c7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -17,15 +17,13 @@ option('man',
)
option('networkmanager',
- type: 'combo',
- choices: ['yes', 'no', 'auto'],
- value: 'auto',
+ type: 'boolean',
+ value: true,
description: 'Enable NetworkManager support'
)
option('systemd',
- type: 'combo',
- choices: ['yes', 'no', 'auto'],
- value: 'auto',
+ type: 'boolean',
+ value: true,
description: 'Enable systemd integration'
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]