-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
75 lines (61 loc) · 2.04 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
project(
'cclip', 'c',
version: '1.3.0-next',
license: 'GPL-3.0-or-later',
default_options: ['buildtype=release', 'warning_level=3']
)
# supported by both clang and gcc and makes my life easier
add_project_arguments('-Wno-gnu-zero-variadic-macro-arguments', language: 'c')
add_project_arguments('-DCCLIP_VERSION="@0@"'.format(meson.project_version()), language: 'c')
wayland_scanner = find_program('wayland-scanner')
static_link = get_option('static')
if static_link
add_project_link_arguments('-static', language: 'c')
endif
sqlite3_dep = dependency('sqlite3', static: static_link)
wayland_client_dep = dependency('wayland-client', static: static_link)
if get_option('man')
scdoc = find_program('scdoc')
foreach man_src : [{'name': 'cclipd', 'section': 1},
{'name': 'cclip', 'section': 1}]
name = man_src['name']
section = man_src['section']
in_file = join_paths('man', '@0@.@1@.scd'.format(name, section))
out_file = '@0@.@1@'.format(name, section)
custom_target(out_file,
output: out_file,
input: in_file,
command: [ scdoc ],
capture: true,
feed: true,
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(section))
)
endforeach
endif
private_code = custom_target('private_code',
output: 'wlr-data-control-unstable-v1.c',
input: 'protocol/wlr-data-control-unstable-v1.xml',
command: [ wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@' ]
)
client_header = custom_target('client_header',
output: 'wlr-data-control-unstable-v1-client-protocol.h',
input: 'protocol/wlr-data-control-unstable-v1.xml',
command: [ wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ]
)
executable('cclip',
'cclip.c',
'db.c',
dependencies: [ sqlite3_dep ],
install: true
)
executable('cclipd',
'cclipd.c',
'db.c',
'wayland.c',
'preview.c',
private_code,
client_header,
dependencies: [ sqlite3_dep, wayland_client_dep ],
install: true
)