meson: check WLR_HAS_XWAYLAND when building with XWayland

This commit is contained in:
Jente Hidskes 2019-01-19 19:21:13 +01:00
parent a8e15442ab
commit a324d22dfe
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

View file

@ -51,8 +51,20 @@ server_protos = declare_dependency(
sources: server_protos_headers,
)
if get_option('xwayland')
cc = meson.get_compiler('c')
wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
if not wlroots_has_xwayland
error('Cannot build Cage with XWayland support: wlroots has been built without it')
else
have_xwayland = true
endif
else
have_xwayland = false
endif
conf_data = configuration_data()
conf_data.set10('CAGE_HAS_XWAYLAND', get_option('xwayland'))
conf_data.set10('CAGE_HAS_XWAYLAND', have_xwayland)
cage_sources = [
'cage.c',