diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/meson.build b/meson.build index 7e26ae2a..5468064f 100644 --- a/meson.build +++ b/meson.build | |||
@@ -43,6 +43,24 @@ subproject( | |||
43 | required: false, | 43 | required: false, |
44 | version: wlroots_version, | 44 | version: wlroots_version, |
45 | ) | 45 | ) |
46 | wlroots = dependency('wlroots', version: wlroots_version) | ||
47 | wlroots_features = { | ||
48 | 'xwayland': false, | ||
49 | 'libinput_backend': false, | ||
50 | 'gles2_renderer': false, | ||
51 | 'session': false, | ||
52 | } | ||
53 | foreach name, _ : wlroots_features | ||
54 | var_name = 'have_' + name.underscorify() | ||
55 | have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true' | ||
56 | wlroots_features += { name: have } | ||
57 | endforeach | ||
58 | |||
59 | if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | ||
60 | error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') | ||
61 | endif | ||
62 | |||
63 | null_dep = dependency('', required: false) | ||
46 | 64 | ||
47 | jsonc = dependency('json-c', version: '>=0.13') | 65 | jsonc = dependency('json-c', version: '>=0.13') |
48 | pcre2 = dependency('libpcre2-8') | 66 | pcre2 = dependency('libpcre2-8') |
@@ -50,14 +68,13 @@ wayland_server = dependency('wayland-server', version: '>=1.21.0') | |||
50 | wayland_client = dependency('wayland-client') | 68 | wayland_client = dependency('wayland-client') |
51 | wayland_cursor = dependency('wayland-cursor') | 69 | wayland_cursor = dependency('wayland-cursor') |
52 | wayland_protos = dependency('wayland-protocols', version: '>=1.24') | 70 | wayland_protos = dependency('wayland-protocols', version: '>=1.24') |
53 | wlroots = dependency('wlroots', version: wlroots_version) | ||
54 | xkbcommon = dependency('xkbcommon') | 71 | xkbcommon = dependency('xkbcommon') |
55 | cairo = dependency('cairo') | 72 | cairo = dependency('cairo') |
56 | pango = dependency('pango') | 73 | pango = dependency('pango') |
57 | pangocairo = dependency('pangocairo') | 74 | pangocairo = dependency('pangocairo') |
58 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) | 75 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) |
59 | pixman = dependency('pixman-1') | 76 | pixman = dependency('pixman-1') |
60 | glesv2 = dependency('glesv2') | 77 | glesv2 = wlroots_features['gles2_renderer'] ? dependency('glesv2') : null_dep |
61 | libevdev = dependency('libevdev') | 78 | libevdev = dependency('libevdev') |
62 | libinput = dependency('libinput', version: '>=1.21.0') | 79 | libinput = dependency('libinput', version: '>=1.21.0') |
63 | xcb = dependency('xcb', required: get_option('xwayland')) | 80 | xcb = dependency('xcb', required: get_option('xwayland')) |
@@ -71,18 +88,6 @@ rt = cc.find_library('rt') | |||
71 | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) | 88 | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) |
72 | threads = dependency('threads') # for pthread_setschedparam | 89 | threads = dependency('threads') # for pthread_setschedparam |
73 | 90 | ||
74 | wlroots_features = { | ||
75 | 'xwayland': false, | ||
76 | } | ||
77 | foreach 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 } | ||
81 | endforeach | ||
82 | |||
83 | if get_option('xwayland').enabled() and not wlroots_features['xwayland'] | ||
84 | error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support') | ||
85 | endif | ||
86 | have_xwayland = xcb.found() and wlroots_features['xwayland'] | 91 | have_xwayland = xcb.found() and wlroots_features['xwayland'] |
87 | 92 | ||
88 | if get_option('sd-bus-provider') == 'auto' | 93 | if get_option('sd-bus-provider') == 'auto' |