-
Notifications
You must be signed in to change notification settings - Fork 13
/
meson.build
55 lines (43 loc) · 1.24 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
project(
'wtype', 'c',
version: '0.4',
license: 'MIT',
default_options : [
'buildtype=release',
'default_library=static'
],
)
git = find_program('git', native: true, required: false)
if not git.found()
add_project_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'c')
else
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
add_project_arguments('-DVERSION=@0@'.format(version), language: 'c')
endif
cc = meson.get_compiler('c')
wayland_client = dependency('wayland-client')
wayland_cursor = dependency('wayland-cursor')
xkbcommon = dependency('xkbcommon')
rt = cc.find_library('rt')
prefix = get_option('prefix')
conf_data = configuration_data()
conf_data.set('prefix', prefix)
src_files = files(
'main.c',
)
subdir('protocol')
install_man('man/wtype.1')
executable(
meson.project_name(),
src_files,
dependencies: [
client_protos,
wayland_client,
wayland_cursor,
rt,
xkbcommon
],
install: true,
)