This repository has been archived by the owner on Aug 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
meson.build
97 lines (85 loc) · 2.03 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
project(
'rootston',
'c',
version: '0.6.0',
license: 'MIT',
meson_version: '>=0.48.0',
default_options: [
'c_std=c11',
'warning_level=2',
'werror=true',
],
)
add_project_arguments([
'-DWLR_USE_UNSTABLE',
], language: 'c')
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments([
'-Wundef',
'-Wlogical-op',
'-Wmissing-include-dirs',
'-Wold-style-definition',
'-Wpointer-arith',
'-Winit-self',
'-Wstrict-prototypes',
'-Wimplicit-fallthrough=2',
'-Wendif-labels',
'-Wstrict-aliasing=2',
'-Woverflow',
'-Wno-missing-braces',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
]), language: 'c')
sources = [
'bindings.c',
'config.c',
'cursor.c',
'desktop.c',
'ini.c',
'input.c',
'keyboard.c',
'layer_shell.c',
'main.c',
'output.c',
'render.c',
'seat.c',
'switch.c',
'text_input.c',
'view.c',
'virtual_keyboard.c',
'xdg_shell_v6.c',
'xdg_shell.c',
]
wayland_server = dependency('wayland-server')
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
pixman = dependency('pixman-1')
# Try first to find wlroots as a subproject, then as a system dependency
wlroots_version = '>=0.6'
wlroots_proj = subproject(
'wlroots',
default_options: ['rootston=false', 'examples=false'],
required: false,
version: wlroots_version,
)
if wlroots_proj.found()
wlroots = wlroots_proj.get_variable('wlroots')
wlroots_conf = wlroots_proj.get_variable('conf_data')
have_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1
else
wlroots = dependency('wlroots', version: wlroots_version)
have_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
endif
if get_option('xwayland').enabled() and not have_xwayland
error('Cannot enable Xwayland: wlroots has been built without Xwayland support')
endif
if have_xwayland
sources += 'xwayland.c'
endif
subdir('protocol')
rootston_inc = include_directories('.', 'include')
executable(
'rootston',
sources,
include_directories: rootston_inc,
dependencies: [wlroots, protos, pixman],
)