-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmeson.build
More file actions
76 lines (63 loc) · 2.28 KB
/
meson.build
File metadata and controls
76 lines (63 loc) · 2.28 KB
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
project('buzzlocker', 'c',
default_options : ['warning_level=3']
)
gnome = import('gnome') # for gresources
cc = meson.get_compiler('c')
sources = [
'src/auth.c',
'src/animation.c',
'src/main.c',
'src/render.c',
'src/display_server.c',
'src/x11_backend.c',
'src/wayland_backend.c',
]
# Check for Wayland support
wayland_client = dependency('wayland-client', version: '>=1.20.0', required: false)
wayland_protocols = dependency('wayland-protocols', version: '>=1.25', required: false)
wayland_scanner = dependency('wayland-scanner', version: '>=1.15.0', required: false)
dependencies = [
dependency('x11'),
dependency('xrandr'),
dependency('cairo'),
dependency('librsvg-2.0'),
dependency('pangocairo'),
dependency('gio-2.0'),
dependency('xkbcommon'),
cc.find_library('pam', required: true),
cc.find_library('pthread', required: true),
]
# Add Wayland dependencies if available
if wayland_client.found() and wayland_protocols.found() and wayland_scanner.found()
dependencies += [wayland_client]
add_project_arguments('-DHAVE_WAYLAND=1', language: 'c')
# Generate Wayland protocol sources
wayland_scanner_prog = find_program(wayland_scanner.get_variable('wayland_scanner'))
wayland_protocols_dir = wayland_protocols.get_variable('pkgdatadir')
# ext-session-lock-v1 protocol
session_lock_xml = wayland_protocols_dir + '/staging/ext-session-lock/ext-session-lock-v1.xml'
session_lock_header = custom_target('ext-session-lock-v1-client-header',
input: session_lock_xml,
output: 'ext-session-lock-v1-client-protocol.h',
command: [wayland_scanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])
session_lock_code = custom_target('ext-session-lock-v1-client-code',
input: session_lock_xml,
output: 'ext-session-lock-v1-client-protocol.c',
command: [wayland_scanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
sources += [session_lock_code, session_lock_header]
message('Building with Wayland support')
else
message('Building without Wayland support - some dependencies missing')
endif
# Resources
resources = gnome.compile_resources(
'resources',
'resources/buzzsaver.gresource.xml',
source_dir: 'resources',
c_name: 'as'
)
executable('auth_buzzlocker',
sources: sources + resources,
dependencies: dependencies,
install: true
)