aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-10 09:49:13 -0500
committerGitHub <noreply@github.com>2018-02-10 09:49:13 -0500
commit8fc7edd636ce827dc147edc890e483bc3e3e9b09 (patch)
treef99478a81eeeee119a30168befaf313e604dedf2 /meson.build
parent07856580c446607fa55888db8ae75491e0447c20 (diff)
parent435aec003376de1928106fa9644b026e36f6250a (diff)
Merge pull request #623 from martinetd/mesonopt
Meson option enhancements
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 17 insertions, 15 deletions
diff --git a/meson.build b/meson.build
index 236abd6b..6c8a3a8b 100644
--- a/meson.build
+++ b/meson.build
@@ -65,29 +65,33 @@ 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)
+exclude_headers = []
+wlr_parts = []
+wlr_deps = []
+
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)
+ wlr_deps += libcap
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)
+ wlr_deps += systemd
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
-exclude_headers = []
-wlr_parts = []
if get_option('enable_xwayland')
subdir('xwayland')
wlr_parts += [lib_wlr_xwayland]
@@ -117,7 +121,7 @@ wlr_parts += [
lib_wlr_xcursor,
]
-wlr_deps = [
+wlr_deps += [
wayland_server,
wayland_client,
wayland_egl,
@@ -133,8 +137,6 @@ wlr_deps = [
xcb,
xcb_composite,
x11_xcb,
- libcap,
- systemd,
math,
]
@@ -159,10 +161,10 @@ summary = [
'----------------',
'wlroots @0@'.format(meson.project_version()),
'',
- ' libcap: @0@'.format(get_option('enable_libcap')),
- ' systemd: @0@'.format(get_option('enable_systemd')),
- ' elogind: @0@'.format(get_option('enable_elogind')),
- ' xwayland: @0@'.format(get_option('enable_xwayland')),
+ ' libcap: @0@'.format(conf_data.get('WLR_HAS_LIBCAP', false)),
+ ' systemd: @0@'.format(conf_data.get('WLR_HAS_SYSTEMD', false)),
+ ' elogind: @0@'.format(conf_data.get('WLR_HAS_ELOGIND', false)),
+ ' xwayland: @0@'.format(conf_data.get('WLR_HAS_XWAYLAND', false)),
'----------------',
''
]