aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build113
1 files changed, 33 insertions, 80 deletions
diff --git a/meson.build b/meson.build
index d23300be..1043e4ba 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
1project( 1project(
2 'sway', 2 'sway',
3 'c', 3 'c',
4 version: '1.8-dev', 4 version: '1.10-dev',
5 license: 'MIT', 5 license: 'MIT',
6 meson_version: '>=0.60.0', 6 meson_version: '>=0.60.0',
7 default_options: [ 7 default_options: [
@@ -14,10 +14,12 @@ project(
14add_project_arguments( 14add_project_arguments(
15 [ 15 [
16 '-DWLR_USE_UNSTABLE', 16 '-DWLR_USE_UNSTABLE',
17 '-D_POSIX_C_SOURCE=200809L',
17 18
18 '-Wno-unused-parameter', 19 '-Wno-unused-parameter',
19 '-Wno-unused-result', 20 '-Wno-unused-result',
20 '-Wno-missing-braces', 21 '-Wno-missing-braces',
22 '-Wno-format-zero-length',
21 '-Wundef', 23 '-Wundef',
22 '-Wvla', 24 '-Wvla',
23 ], 25 ],
@@ -36,55 +38,54 @@ if is_freebsd
36endif 38endif
37 39
38# Execute the wlroots subproject, if any 40# Execute the wlroots subproject, if any
39wlroots_version = ['>=0.16.0', '<0.17.0'] 41wlroots_version = ['>=0.18.0', '<0.19.0']
40subproject( 42subproject(
41 'wlroots', 43 'wlroots',
42 default_options: ['examples=false'], 44 default_options: ['examples=false'],
43 required: false, 45 required: false,
44 version: wlroots_version, 46 version: wlroots_version,
45) 47)
48wlroots = dependency('wlroots', version: wlroots_version)
49wlroots_features = {
50 'xwayland': false,
51 'libinput_backend': false,
52 'session': false,
53}
54foreach name, _ : wlroots_features
55 var_name = 'have_' + name.underscorify()
56 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
57 wlroots_features += { name: have }
58endforeach
59
60if get_option('xwayland').enabled() and not wlroots_features['xwayland']
61 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
62endif
63
64null_dep = dependency('', required: false)
46 65
47jsonc = dependency('json-c', version: '>=0.13') 66jsonc = dependency('json-c', version: '>=0.13')
48pcre2 = dependency('libpcre2-8') 67pcre2 = dependency('libpcre2-8')
49wayland_server = dependency('wayland-server', version: '>=1.20.0') 68wayland_server = dependency('wayland-server', version: '>=1.21.0')
50wayland_client = dependency('wayland-client') 69wayland_client = dependency('wayland-client')
51wayland_cursor = dependency('wayland-cursor') 70wayland_cursor = dependency('wayland-cursor')
52wayland_egl = dependency('wayland-egl')
53wayland_protos = dependency('wayland-protocols', version: '>=1.24') 71wayland_protos = dependency('wayland-protocols', version: '>=1.24')
54wlroots = dependency('wlroots', version: wlroots_version) 72xkbcommon = dependency('xkbcommon', version: '>=1.5.0')
55xkbcommon = dependency('xkbcommon')
56cairo = dependency('cairo') 73cairo = dependency('cairo')
57pango = dependency('pango') 74pango = dependency('pango')
58pangocairo = dependency('pangocairo') 75pangocairo = dependency('pangocairo')
59gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) 76gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
60pixman = dependency('pixman-1') 77pixman = dependency('pixman-1')
61glesv2 = dependency('glesv2')
62libevdev = dependency('libevdev') 78libevdev = dependency('libevdev')
63libinput = dependency('libinput', version: '>=1.6.0') 79libinput = wlroots_features['libinput_backend'] ? dependency('libinput', version: '>=1.21.0') : null_dep
64xcb = dependency('xcb', required: get_option('xwayland')) 80xcb = dependency('xcb', required: get_option('xwayland'))
65drm_full = dependency('libdrm') # only needed for drm_fourcc.h 81drm = dependency('libdrm')
66drm = drm_full.partial_dependency(compile_args: true, includes: true) 82libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : null_dep
67libudev = dependency('libudev')
68bash_comp = dependency('bash-completion', required: false)
69fish_comp = dependency('fish', required: false)
70math = cc.find_library('m') 83math = cc.find_library('m')
71rt = cc.find_library('rt') 84rt = cc.find_library('rt')
72xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) 85xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
73threads = dependency('threads') # for pthread_setschedparam 86threads = dependency('threads') # for pthread_setschedparam
74 87
75wlroots_features = { 88have_xwayland = xcb.found() and xcb_icccm.found() and wlroots_features['xwayland']
76 'xwayland': false,
77}
78foreach name, _ : wlroots_features
79 var_name = 'have_' + name.underscorify()
80 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
81 wlroots_features += { name: have }
82endforeach
83
84if get_option('xwayland').enabled() and not wlroots_features['xwayland']
85 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
86endif
87have_xwayland = xcb.found() and wlroots_features['xwayland']
88 89
89if get_option('sd-bus-provider') == 'auto' 90if get_option('sd-bus-provider') == 'auto'
90 if not get_option('tray').disabled() 91 if not get_option('tray').disabled()
@@ -115,6 +116,11 @@ conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd
115conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') 116conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
116conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') 117conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
117conf_data.set10('HAVE_TRAY', have_tray) 118conf_data.set10('HAVE_TRAY', have_tray)
119conf_data.set10('HAVE_LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', cc.has_header_symbol(
120 'libinput.h',
121 'LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM',
122 dependencies: libinput,
123))
118 124
119scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) 125scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
120if scdoc.found() 126if scdoc.found()
@@ -262,59 +268,7 @@ if get_option('default-wallpaper')
262 install_data(wallpaper_files, install_dir: wallpaper_install_dir) 268 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
263endif 269endif
264 270
265if get_option('zsh-completions') 271subdir('completions')
266 zsh_files = files(
267 'completions/zsh/_sway',
268 'completions/zsh/_swaymsg',
269 )
270 zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
271
272 install_data(zsh_files, install_dir: zsh_install_dir)
273endif
274
275if get_option('bash-completions')
276 bash_files = files(
277 'completions/bash/sway',
278 'completions/bash/swaymsg',
279 )
280
281 if get_option('swaybar')
282 bash_files += files('completions/bash/swaybar')
283 endif
284
285 if bash_comp.found()
286 bash_install_dir = bash_comp.get_variable(
287 pkgconfig: 'completionsdir',
288 pkgconfig_define: ['datadir', datadir]
289 )
290 else
291 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
292 endif
293
294 install_data(bash_files, install_dir: bash_install_dir)
295endif
296
297if get_option('fish-completions')
298 fish_files = files(
299 'completions/fish/sway.fish',
300 'completions/fish/swaymsg.fish',
301 )
302
303 if get_option('swaynag')
304 fish_files += files('completions/fish/swaynag.fish')
305 endif
306
307 if fish_comp.found()
308 fish_install_dir = fish_comp.get_variable(
309 pkgconfig: 'completionsdir',
310 pkgconfig_define: ['datadir', datadir]
311 )
312 else
313 fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
314 endif
315
316 install_data(fish_files, install_dir: fish_install_dir)
317endif
318 272
319summary({ 273summary({
320 'xwayland': have_xwayland, 274 'xwayland': have_xwayland,
@@ -322,4 +276,3 @@ summary({
322 'tray': have_tray, 276 'tray': have_tray,
323 'man-pages': scdoc.found(), 277 'man-pages': scdoc.found(),
324}, bool_yn: true) 278}, bool_yn: true)
325