aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-02-10 10:46:27 +0100
committerDominique Martinet <asmadeus@codewreck.org>2018-02-10 10:46:27 +0100
commit161ae2fcb41e1a5e8fbc56a375b332ec63c47bf2 (patch)
treecf0fdde9e894806027f78e7b556c9c00117eb1f0
parent19d7edb4301ac2c4ad3d7f7512214dad2414d64b (diff)
meson build: make enable options work as auto/true/false
This makes meson fail if -Denable_systemd=true was set but not found The default is now auto which is the old behaviour
-rw-r--r--meson.build12
-rw-r--r--meson_options.txt6
2 files changed, 9 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index a2f08446..43af94a8 100644
--- a/meson.build
+++ b/meson.build
@@ -65,24 +65,24 @@ xcb_image = dependency('xcb-image')
xcb_render = dependency('xcb-render')
xcb_icccm = dependency('xcb-icccm', required: false)
x11_xcb = dependency('x11-xcb')
-libcap = dependency('libcap', required: false)
-systemd = dependency('libsystemd', required: false)
-elogind = dependency('libelogind', required: false)
+libcap = dependency('libcap', required: get_option('enable_libcap') == 'true')
+systemd = dependency('libsystemd', required: get_option('enable_systemd') == 'true')
+elogind = dependency('libelogind', required: get_option('enable_elogind') == 'true')
math = cc.find_library('m', required: false)
if xcb_icccm.found()
conf_data.set('WLR_HAS_XCB_ICCCM', true)
endif
-if libcap.found() and get_option('enable_libcap')
+if libcap.found() and get_option('enable_libcap') != 'false'
conf_data.set('WLR_HAS_LIBCAP', true)
endif
-if systemd.found() and get_option('enable_systemd')
+if systemd.found() and get_option('enable_systemd') != 'false'
conf_data.set('WLR_HAS_SYSTEMD', true)
endif
-if elogind.found() and get_option('enable_elogind')
+if elogind.found() and get_option('enable_elogind') != 'false'
conf_data.set('WLR_HAS_ELOGIND', true)
endif
diff --git a/meson_options.txt b/meson_options.txt
index b1e64bd9..6434b43d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
-option('enable_libcap', type: 'boolean', value: true, description: 'Enable support for capabilities')
-option('enable_systemd', type: 'boolean', value: true, description: 'Enable support for logind')
-option('enable_elogind', type: 'boolean', value: true, description: 'Enable support for logind')
+option('enable_libcap', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for capabilities')
+option('enable_systemd', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind')
+option('enable_elogind', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind')
option('enable_xwayland', type: 'boolean', value: true, description: 'Enable support X11 applications')