diff options
-rw-r--r-- | meson.build | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/meson.build b/meson.build index 38a55678..9177ca33 100644 --- a/meson.build +++ b/meson.build | |||
@@ -65,26 +65,23 @@ wlroots_proj = subproject( | |||
65 | required: false, | 65 | required: false, |
66 | version: wlroots_version, | 66 | version: wlroots_version, |
67 | ) | 67 | ) |
68 | if wlroots_proj.found() | ||
69 | wlroots = wlroots_proj.get_variable('wlroots') | ||
70 | else | ||
71 | wlroots = dependency('wlroots', version: wlroots_version) | ||
72 | endif | ||
73 | |||
68 | wlroots_features = { | 74 | wlroots_features = { |
69 | 'xwayland': false, | 75 | 'xwayland': false, |
70 | 'systemd': false, | 76 | 'systemd': false, |
71 | 'elogind': false, | 77 | 'elogind': false, |
72 | 'libseat': false, | 78 | 'libseat': false, |
73 | } | 79 | } |
74 | if wlroots_proj.found() | 80 | foreach name, _ : wlroots_features |
75 | wlroots = wlroots_proj.get_variable('wlroots') | 81 | var_name = 'have_' + name.underscorify() |
76 | wlroots_conf = wlroots_proj.get_variable('conf_data') | 82 | have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true' |
77 | foreach name, _ : wlroots_features | 83 | wlroots_features += { name: have } |
78 | has = wlroots_conf.get('WLR_HAS_' + name.to_upper()) == 1 | 84 | endforeach |
79 | wlroots_features += { name: has } | ||
80 | endforeach | ||
81 | else | ||
82 | 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 | ||
88 | 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') |