aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build70
1 files changed, 31 insertions, 39 deletions
diff --git a/meson.build b/meson.build
index 38a55678..3681547d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
1project( 1project(
2 'sway', 2 'sway',
3 'c', 3 'c',
4 version: '1.5', #release_version 4 version: '1.6',
5 license: 'MIT', 5 license: 'MIT',
6 meson_version: '>=0.53.0', 6 meson_version: '>=0.53.0',
7 default_options: [ 7 default_options: [
@@ -35,57 +35,54 @@ if is_freebsd
35 add_project_arguments('-D_C11_SOURCE', language: 'c') 35 add_project_arguments('-D_C11_SOURCE', language: 'c')
36endif 36endif
37 37
38jsonc = dependency('json-c', version: '>=0.13') 38jsonc = dependency('json-c', version: '>=0.13')
39pcre = dependency('libpcre') 39pcre = dependency('libpcre')
40wayland_server = dependency('wayland-server') 40wayland_server = dependency('wayland-server')
41wayland_client = dependency('wayland-client') 41wayland_client = dependency('wayland-client')
42wayland_cursor = dependency('wayland-cursor') 42wayland_cursor = dependency('wayland-cursor')
43wayland_egl = dependency('wayland-egl') 43wayland_egl = dependency('wayland-egl')
44wayland_protos = dependency('wayland-protocols', version: '>=1.14') 44wayland_protos = dependency('wayland-protocols', version: '>=1.14')
45xkbcommon = dependency('xkbcommon') 45xkbcommon = dependency('xkbcommon')
46cairo = dependency('cairo') 46cairo = dependency('cairo')
47pango = dependency('pango') 47pango = dependency('pango')
48pangocairo = dependency('pangocairo') 48pangocairo = dependency('pangocairo')
49gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) 49gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
50pixman = dependency('pixman-1') 50pixman = dependency('pixman-1')
51glesv2 = dependency('glesv2') 51glesv2 = dependency('glesv2')
52libevdev = dependency('libevdev') 52libevdev = dependency('libevdev')
53libinput = dependency('libinput', version: '>=1.6.0') 53libinput = dependency('libinput', version: '>=1.6.0')
54xcb = dependency('xcb', required: get_option('xwayland')) 54xcb = dependency('xcb', required: get_option('xwayland'))
55bash_comp = dependency('bash-completion', required: false) 55drm_full = dependency('libdrm') # only needed for drm_fourcc.h
56fish_comp = dependency('fish', required: false) 56drm = drm_full.partial_dependency(compile_args: true, includes: true)
57math = cc.find_library('m') 57libudev = dependency('libudev')
58rt = cc.find_library('rt') 58bash_comp = dependency('bash-completion', required: false)
59fish_comp = dependency('fish', required: false)
60math = cc.find_library('m')
61rt = cc.find_library('rt')
59 62
60# Try first to find wlroots as a subproject, then as a system dependency 63# Try first to find wlroots as a subproject, then as a system dependency
61wlroots_version = ['>=0.12.0', '<0.13.0'] 64wlroots_version = ['>=0.14.0', '<0.15.0']
62wlroots_proj = subproject( 65wlroots_proj = subproject(
63 'wlroots', 66 'wlroots',
64 default_options: ['examples=false'], 67 default_options: ['examples=false'],
65 required: false, 68 required: false,
66 version: wlroots_version, 69 version: wlroots_version,
67) 70)
68wlroots_features = {
69 'xwayland': false,
70 'systemd': false,
71 'elogind': false,
72 'libseat': false,
73}
74if wlroots_proj.found() 71if wlroots_proj.found()
75 wlroots = wlroots_proj.get_variable('wlroots') 72 wlroots = wlroots_proj.get_variable('wlroots')
76 wlroots_conf = wlroots_proj.get_variable('conf_data')
77 foreach name, _ : wlroots_features
78 has = wlroots_conf.get('WLR_HAS_' + name.to_upper()) == 1
79 wlroots_features += { name: has }
80 endforeach
81else 73else
82 wlroots = dependency('wlroots', version: wlroots_version) 74 wlroots = dependency('wlroots', version: wlroots_version)
83 foreach name, _ : wlroots_features
84 has = cc.get_define('WLR_HAS_' + name.to_upper(), prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
85 wlroots_features += { name: has }
86 endforeach
87endif 75endif
88 76
77wlroots_features = {
78 'xwayland': false,
79}
80foreach name, _ : wlroots_features
81 var_name = 'have_' + name.underscorify()
82 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
83 wlroots_features += { name: have }
84endforeach
85
89if get_option('xwayland').enabled() and not wlroots_features['xwayland'] 86if get_option('xwayland').enabled() and not wlroots_features['xwayland']
90 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') 87 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
91endif 88endif
@@ -313,12 +310,7 @@ endif
313summary({ 310summary({
314 'xwayland': have_xwayland, 311 'xwayland': have_xwayland,
315 'gdk-pixbuf': gdk_pixbuf.found(), 312 'gdk-pixbuf': gdk_pixbuf.found(),
316 'sd-bus': sdbus.found(),
317 'tray': have_tray, 313 'tray': have_tray,
318 'man-pages': scdoc.found(), 314 'man-pages': scdoc.found(),
319}, bool_yn: true) 315}, bool_yn: true)
320 316
321if not wlroots_features['systemd'] and not wlroots_features['elogind'] and not wlroots_features['libseat']
322 warning('The sway binary must be setuid when compiled without (e)logind or libseat')
323 warning('You must do this manually post-install: chmod a+s /path/to/sway')
324endif