aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build114
1 files changed, 34 insertions, 80 deletions
diff --git a/meson.build b/meson.build
index 46352da5..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,54 +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'))
86threads = dependency('threads') # for pthread_setschedparam
73 87
74wlroots_features = { 88have_xwayland = xcb.found() and xcb_icccm.found() and wlroots_features['xwayland']
75 'xwayland': false,
76}
77foreach name, _ : wlroots_features
78 var_name = 'have_' + name.underscorify()
79 have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
80 wlroots_features += { name: have }
81endforeach
82
83if get_option('xwayland').enabled() and not wlroots_features['xwayland']
84 error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
85endif
86have_xwayland = xcb.found() and wlroots_features['xwayland']
87 89
88if get_option('sd-bus-provider') == 'auto' 90if get_option('sd-bus-provider') == 'auto'
89 if not get_option('tray').disabled() 91 if not get_option('tray').disabled()
@@ -114,6 +116,11 @@ conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd
114conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') 116conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
115conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') 117conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
116conf_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))
117 124
118scdoc = 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'))
119if scdoc.found() 126if scdoc.found()
@@ -261,59 +268,7 @@ if get_option('default-wallpaper')
261 install_data(wallpaper_files, install_dir: wallpaper_install_dir) 268 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
262endif 269endif
263 270
264if get_option('zsh-completions') 271subdir('completions')
265 zsh_files = files(
266 'completions/zsh/_sway',
267 'completions/zsh/_swaymsg',
268 )
269 zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
270
271 install_data(zsh_files, install_dir: zsh_install_dir)
272endif
273
274if get_option('bash-completions')
275 bash_files = files(
276 'completions/bash/sway',
277 'completions/bash/swaymsg',
278 )
279
280 if get_option('swaybar')
281 bash_files += files('completions/bash/swaybar')
282 endif
283
284 if bash_comp.found()
285 bash_install_dir = bash_comp.get_variable(
286 pkgconfig: 'completionsdir',
287 pkgconfig_define: ['datadir', datadir]
288 )
289 else
290 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
291 endif
292
293 install_data(bash_files, install_dir: bash_install_dir)
294endif
295
296if get_option('fish-completions')
297 fish_files = files(
298 'completions/fish/sway.fish',
299 'completions/fish/swaymsg.fish',
300 )
301
302 if get_option('swaynag')
303 fish_files += files('completions/fish/swaynag.fish')
304 endif
305
306 if fish_comp.found()
307 fish_install_dir = fish_comp.get_variable(
308 pkgconfig: 'completionsdir',
309 pkgconfig_define: ['datadir', datadir]
310 )
311 else
312 fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
313 endif
314
315 install_data(fish_files, install_dir: fish_install_dir)
316endif
317 272
318summary({ 273summary({
319 'xwayland': have_xwayland, 274 'xwayland': have_xwayland,
@@ -321,4 +276,3 @@ summary({
321 'tray': have_tray, 276 'tray': have_tray,
322 'man-pages': scdoc.found(), 277 'man-pages': scdoc.found(),
323}, bool_yn: true) 278}, bool_yn: true)
324