-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmeson.build
84 lines (71 loc) · 1.43 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
project(
'wl-gammactl',
'c'
)
# Define dependecies
dep_gtk3 = dependency('gtk+-3.0')
dep_wlroots = dependency('wlroots')
dep_wayland_client = dependency('wayland-client')
# Compile gresources
gres_xml = join_paths(
meson.source_root(),
'glade/window_main.gresource.xml'
)
gres_src = join_paths(
meson.source_root(),
'src/resources.c'
)
glib_compiler = find_program('glib-compile-resources')
run_command(
glib_compiler,
'--target=@0@'.format(gres_src),
'--generate-source',
gres_xml
)
# Get protocol extensions
git = find_program('git')
run_command(
git,
'submodule',
'add',
'https://github.com/swaywm/wlr-protocols.git',
'wlr-protocols/'
)
run_command(
git,
'submodule',
'update',
'--init',
'--recursive'
)
# Run wayland-scanner
wayland_scanner = find_program('wayland-scanner')
run_command(
wayland_scanner,
'private-code',
'wlr-protocols/unstable/wlr-gamma-control-unstable-v1.xml',
'src/wlr-gamma-control-unstable-v1-client-protocol.c',
)
run_command(
wayland_scanner,
'client-header',
'wlr-protocols/unstable/wlr-gamma-control-unstable-v1.xml',
'src/wlr-gamma-control-unstable-v1-client-protocol.h',
)
sources = [
'src/main.c',
'src/wlr-gamma-control-unstable-v1-client-protocol.c',
'src/wlr-gamma-control-unstable-v1-client-protocol.h',
'src/resources.c'
]
executable(
'wl-gammactl',
sources,
dependencies : [
dep_wlroots,
dep_wayland_client,
dep_gtk3
],
link_args: ['-rdynamic', '-lm'],
install: true
)