-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmeson.build
66 lines (57 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
project(
'kiwmi',
'c',
license: 'MPL-2.0',
default_options: [
'c_std=c11',
'warning_level=2',
],
)
add_project_arguments(
[
'-DWLR_USE_UNSTABLE',
'-D_POSIX_C_SOURCE=200809L',
],
language: 'c',
)
git = find_program('git', required: false)
lua = dependency(get_option('lua-pkg'))
pixman = dependency('pixman-1')
wayland_client = dependency('wayland-client')
wayland_protocols = dependency('wayland-protocols')
wayland_scanner = dependency('wayland-scanner')
wayland_server = dependency('wayland-server')
wlroots = dependency('wlroots')
xkbcommon = dependency('xkbcommon')
include = include_directories('include')
version = get_option('kiwmi-version')
if version != ''
version = '"@0@"'.format(version)
else
if not git.found()
error('git is required to make the version string')
endif
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags'], check: false)
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
if git_commit_hash.returncode() != 0 or git_branch.returncode() != 0
error('need the git directory to make the version string')
endif
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(
git_commit_hash.stdout().strip(),
git_branch.stdout().strip(),
)
endif
add_project_arguments('-DKIWMI_VERSION=@0@'.format(version), language: 'c')
compiler = meson.get_compiler('c')
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang'
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x __attribute__((__unused__))', language: 'c')
else
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x', language: 'c')
endif
install_data(
'kiwmi.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions')
)
subdir('protocols')
subdir('kiwmi')
subdir('kiwmic')