diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 113 |
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 @@ | |||
1 | project( | 1 | project( |
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( | |||
14 | add_project_arguments( | 14 | add_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 | |||
36 | endif | 38 | endif |
37 | 39 | ||
38 | # Execute the wlroots subproject, if any | 40 | # Execute the wlroots subproject, if any |
39 | wlroots_version = ['>=0.16.0', '<0.17.0'] | 41 | wlroots_version = ['>=0.18.0', '<0.19.0'] |
40 | subproject( | 42 | subproject( |
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 | ) |
48 | wlroots = dependency('wlroots', version: wlroots_version) | ||
49 | wlroots_features = { | ||
50 | 'xwayland': false, | ||
51 | 'libinput_backend': false, | ||
52 | 'session': false, | ||
53 | } | ||
54 | foreach 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 } | ||
58 | endforeach | ||
59 | |||
60 | if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | ||
61 | error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') | ||
62 | endif | ||
63 | |||
64 | null_dep = dependency('', required: false) | ||
46 | 65 | ||
47 | jsonc = dependency('json-c', version: '>=0.13') | 66 | jsonc = dependency('json-c', version: '>=0.13') |
48 | pcre2 = dependency('libpcre2-8') | 67 | pcre2 = dependency('libpcre2-8') |
49 | wayland_server = dependency('wayland-server', version: '>=1.20.0') | 68 | wayland_server = dependency('wayland-server', version: '>=1.21.0') |
50 | wayland_client = dependency('wayland-client') | 69 | wayland_client = dependency('wayland-client') |
51 | wayland_cursor = dependency('wayland-cursor') | 70 | wayland_cursor = dependency('wayland-cursor') |
52 | wayland_egl = dependency('wayland-egl') | ||
53 | wayland_protos = dependency('wayland-protocols', version: '>=1.24') | 71 | wayland_protos = dependency('wayland-protocols', version: '>=1.24') |
54 | wlroots = dependency('wlroots', version: wlroots_version) | 72 | xkbcommon = dependency('xkbcommon', version: '>=1.5.0') |
55 | xkbcommon = dependency('xkbcommon') | ||
56 | cairo = dependency('cairo') | 73 | cairo = dependency('cairo') |
57 | pango = dependency('pango') | 74 | pango = dependency('pango') |
58 | pangocairo = dependency('pangocairo') | 75 | pangocairo = dependency('pangocairo') |
59 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) | 76 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) |
60 | pixman = dependency('pixman-1') | 77 | pixman = dependency('pixman-1') |
61 | glesv2 = dependency('glesv2') | ||
62 | libevdev = dependency('libevdev') | 78 | libevdev = dependency('libevdev') |
63 | libinput = dependency('libinput', version: '>=1.6.0') | 79 | libinput = wlroots_features['libinput_backend'] ? dependency('libinput', version: '>=1.21.0') : null_dep |
64 | xcb = dependency('xcb', required: get_option('xwayland')) | 80 | xcb = dependency('xcb', required: get_option('xwayland')) |
65 | drm_full = dependency('libdrm') # only needed for drm_fourcc.h | 81 | drm = dependency('libdrm') |
66 | drm = drm_full.partial_dependency(compile_args: true, includes: true) | 82 | libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : null_dep |
67 | libudev = dependency('libudev') | ||
68 | bash_comp = dependency('bash-completion', required: false) | ||
69 | fish_comp = dependency('fish', required: false) | ||
70 | math = cc.find_library('m') | 83 | math = cc.find_library('m') |
71 | rt = cc.find_library('rt') | 84 | rt = cc.find_library('rt') |
72 | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) | 85 | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) |
73 | threads = dependency('threads') # for pthread_setschedparam | 86 | threads = dependency('threads') # for pthread_setschedparam |
74 | 87 | ||
75 | wlroots_features = { | 88 | have_xwayland = xcb.found() and xcb_icccm.found() and wlroots_features['xwayland'] |
76 | 'xwayland': false, | ||
77 | } | ||
78 | foreach 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 } | ||
82 | endforeach | ||
83 | |||
84 | if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | ||
85 | error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') | ||
86 | endif | ||
87 | have_xwayland = xcb.found() and wlroots_features['xwayland'] | ||
88 | 89 | ||
89 | if get_option('sd-bus-provider') == 'auto' | 90 | if 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 | |||
115 | conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') | 116 | conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') |
116 | conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') | 117 | conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') |
117 | conf_data.set10('HAVE_TRAY', have_tray) | 118 | conf_data.set10('HAVE_TRAY', have_tray) |
119 | conf_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 | ||
119 | scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) | 125 | scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) |
120 | if scdoc.found() | 126 | if 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) |
263 | endif | 269 | endif |
264 | 270 | ||
265 | if get_option('zsh-completions') | 271 | subdir('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) | ||
273 | endif | ||
274 | |||
275 | if 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) | ||
295 | endif | ||
296 | |||
297 | if 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) | ||
317 | endif | ||
318 | 272 | ||
319 | summary({ | 273 | summary({ |
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 | |||