diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 70 |
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 @@ | |||
1 | project( | 1 | project( |
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') |
36 | endif | 36 | endif |
37 | 37 | ||
38 | jsonc = dependency('json-c', version: '>=0.13') | 38 | jsonc = dependency('json-c', version: '>=0.13') |
39 | pcre = dependency('libpcre') | 39 | pcre = dependency('libpcre') |
40 | wayland_server = dependency('wayland-server') | 40 | wayland_server = dependency('wayland-server') |
41 | wayland_client = dependency('wayland-client') | 41 | wayland_client = dependency('wayland-client') |
42 | wayland_cursor = dependency('wayland-cursor') | 42 | wayland_cursor = dependency('wayland-cursor') |
43 | wayland_egl = dependency('wayland-egl') | 43 | wayland_egl = dependency('wayland-egl') |
44 | wayland_protos = dependency('wayland-protocols', version: '>=1.14') | 44 | wayland_protos = dependency('wayland-protocols', version: '>=1.14') |
45 | xkbcommon = dependency('xkbcommon') | 45 | xkbcommon = dependency('xkbcommon') |
46 | cairo = dependency('cairo') | 46 | cairo = dependency('cairo') |
47 | pango = dependency('pango') | 47 | pango = dependency('pango') |
48 | pangocairo = dependency('pangocairo') | 48 | pangocairo = dependency('pangocairo') |
49 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) | 49 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) |
50 | pixman = dependency('pixman-1') | 50 | pixman = dependency('pixman-1') |
51 | glesv2 = dependency('glesv2') | 51 | glesv2 = dependency('glesv2') |
52 | libevdev = dependency('libevdev') | 52 | libevdev = dependency('libevdev') |
53 | libinput = dependency('libinput', version: '>=1.6.0') | 53 | libinput = dependency('libinput', version: '>=1.6.0') |
54 | xcb = dependency('xcb', required: get_option('xwayland')) | 54 | xcb = dependency('xcb', required: get_option('xwayland')) |
55 | bash_comp = dependency('bash-completion', required: false) | 55 | drm_full = dependency('libdrm') # only needed for drm_fourcc.h |
56 | fish_comp = dependency('fish', required: false) | 56 | drm = drm_full.partial_dependency(compile_args: true, includes: true) |
57 | math = cc.find_library('m') | 57 | libudev = dependency('libudev') |
58 | rt = cc.find_library('rt') | 58 | bash_comp = dependency('bash-completion', required: false) |
59 | fish_comp = dependency('fish', required: false) | ||
60 | math = cc.find_library('m') | ||
61 | rt = 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 |
61 | wlroots_version = ['>=0.12.0', '<0.13.0'] | 64 | wlroots_version = ['>=0.14.0', '<0.15.0'] |
62 | wlroots_proj = subproject( | 65 | wlroots_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 | ) |
68 | wlroots_features = { | ||
69 | 'xwayland': false, | ||
70 | 'systemd': false, | ||
71 | 'elogind': false, | ||
72 | 'libseat': false, | ||
73 | } | ||
74 | if wlroots_proj.found() | 71 | if 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 | ||
81 | else | 73 | else |
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 | ||
87 | endif | 75 | endif |
88 | 76 | ||
77 | wlroots_features = { | ||
78 | 'xwayland': false, | ||
79 | } | ||
80 | foreach 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 } | ||
84 | endforeach | ||
85 | |||
89 | if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | 86 | if 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') |
91 | endif | 88 | endif |
@@ -313,12 +310,7 @@ endif | |||
313 | summary({ | 310 | summary({ |
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 | ||
321 | if 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') | ||
324 | endif | ||