-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
meson.build
77 lines (66 loc) · 2.02 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
75
76
77
project('zathura-pdf-poppler', 'c',
version: '0.3.3',
meson_version: '>=0.61',
default_options: ['c_std=c17', 'warning_level=3']
)
version = meson.project_version()
version_array = version.split('.')
cc = meson.get_compiler('c')
prefix = get_option('prefix')
datadir = get_option('datadir')
metainfodir = join_paths(datadir, 'metainfo')
desktopdir = join_paths(datadir, 'applications')
# required dependencies
zathura = dependency('zathura', version: '>=0.5.3', fallback: ['zathura', 'zathura_dependency'])
girara = dependency('girara-gtk3', fallback: ['girara', 'girara_dependency'])
glib = dependency('glib-2.0')
poppler = dependency('poppler-glib', version: '>=21.12')
build_dependencies = [zathura, girara, glib, poppler]
if get_option('plugindir') == ''
if zathura.type_name() == 'pkgconfig'
plugindir = zathura.get_variable(pkgconfig: 'plugindir')
else
zathura_subproject = subproject('zathura')
plugindir = zathura_subproject.get_variable('plugindir')
endif
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 = [
'-Werror=implicit-function-declaration',
'-Werror=vla',
]
flags = cc.get_supported_arguments(flags)
sources = files(
'zathura-pdf-poppler/attachments.c',
'zathura-pdf-poppler/document.c',
'zathura-pdf-poppler/forms.c',
'zathura-pdf-poppler/image.c',
'zathura-pdf-poppler/index.c',
'zathura-pdf-poppler/links.c',
'zathura-pdf-poppler/meta.c',
'zathura-pdf-poppler/page.c',
'zathura-pdf-poppler/plugin.c',
'zathura-pdf-poppler/render.c',
'zathura-pdf-poppler/search.c',
'zathura-pdf-poppler/select.c',
'zathura-pdf-poppler/signature.c',
'zathura-pdf-poppler/utils.c'
)
pdf = shared_module('pdf-poppler',
sources,
dependencies: build_dependencies,
c_args: defines + flags,
install: true,
install_dir: plugindir,
gnu_symbol_visibility: 'hidden'
)
subdir('data')