-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
86 lines (72 loc) · 1.83 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
project(
'wayal',
'c',
version: '0.1',
license: 'ISC',
default_options: [
'c_std=c11',
'warning_level=2',
'werror=true',
]
)
add_project_arguments(
[
'-Wno-unused-parameter',
'-D_GNU_SOURCE',
'-D_POSIX_C_SOURCE=200809L',
],
language: 'c',
)
cc = meson.get_compiler('c')
cairo = dependency('cairo')
pangocairo = dependency('pangocairo')
xkbcommon = dependency('xkbcommon')
giounix = dependency('gio-unix-2.0')
wayland_protos = dependency('wayland-protocols', version: '>=1.13')
wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
wayland_scanner = find_program('wayland-scanner')
wayland_client = dependency('wayland-client')
wayland_scanner_code = generator(
wayland_scanner,
output: '@[email protected]',
arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
)
wayland_scanner_client = generator(
wayland_scanner,
output: '@[email protected]',
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
)
client_protocols = [
[wl_protocol_dir + '/stable/xdg-shell', 'xdg-shell.xml'],
[meson.source_root() + '/protocols', 'wlr-layer-shell-unstable-v1.xml'],
]
foreach p : client_protocols
xml = join_paths(p)
src = wayland_scanner_code.process(xml)
header = wayland_scanner_client.process(xml)
name = p[1].split('.')[0].underscorify()
lib = static_library(
name,
[src, header],
dependencies: [wayland_client],
)
dep = declare_dependency(
link_with: lib,
sources: header,
)
set_variable(name, dep)
endforeach
src_files = files(
'src/main.c',
'src/wayal.c',
'src/window.c',
'src/input.c',
'src/xdg_app.c',
)
executable(
'wayal',
src_files,
dependencies: [cairo, pangocairo, giounix, xkbcommon, wayland_client, wlr_layer_shell_unstable_v1, xdg_shell],
include_directories: [include_directories('include')],
install: true
)