-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
61 lines (51 loc) · 1.3 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
project('zathura-txt', 'c',
version: '0.0.1',
meson_version: '>=0.43',
default_options: 'c_std=c11'
)
version = meson.project_version()
version_array = version.split('.')
cc = meson.get_compiler('c')
datadir = get_option('datadir')
desktopdir = join_paths(datadir, 'applications')
metainfodir = join_paths(datadir, 'metainfo')
# required dependencies
zathura = dependency('zathura', version: '>=0.3.8')
girara = dependency('girara-gtk3')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
build_dependencies = [zathura, girara, glib, cairo]
if get_option('plugindir') == ''
plugindir = zathura.get_pkgconfig_variable('plugindir')
else
plugindir = get_option('plugindir')
endif
# defines
defines = [
'-DVERSION_MAJOR=@0@'.format(version_array[0]),
'-DVERSION_MINOR=@0@'.format(version_array[1]),
'-DVERSION_REV=@0@'.format(version_array[2]),
'-D_DEFAULT_SOURCE',
]
# compile flags
flags = [
'-Wall',
'-Wextra',
'-pedantic',
'-Werror=implicit-function-declaration',
'-Werror=vla',
'-fvisibility=hidden'
]
flags = cc.get_supported_arguments(flags)
sources = files(
'zathura-txt/document.c',
'zathura-txt/page.c',
'zathura-txt/plugin.c',
)
txt = shared_module('txt',
sources,
dependencies: build_dependencies,
c_args: defines + flags,
install: true,
install_dir: plugindir
)