forked from latchset/jose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
99 lines (85 loc) · 2.31 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
project('jose', 'c', license: 'APL2',
version: '12',
default_options: [
'c_std=gnu99',
'prefix=/usr',
'warning_level=2',
'werror=true'
],
meson_version: '>=0.47.0',
)
buildtype = get_option('buildtype')
build_static = get_option('build_static')
build_dynamic = get_option('build_dynamic')
build_executable = get_option('build_executable')
if (build_executable == true)
build_dynamic = true
endif
licensedir = join_paths(get_option('prefix'), 'share', 'licenses', meson.project_name())
if host_machine.system() == 'freebsd'
licensedir += '-'+meson.project_version()
endif
add_project_arguments(
'-Wstrict-aliasing',
'-Wchar-subscripts',
'-Wformat-security',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-prototypes',
'-Wtype-limits',
'-Wunused-function',
'-Wno-missing-field-initializers',
'-Wno-unused-command-line-argument',
'-Wno-unused-parameter',
'-Wno-unknown-pragmas',
language: 'c'
)
zlib = dependency('zlib')
threads = dependency('threads')
jansson = dependency('jansson', version: '>=2.10')
libcrypto = dependency('libcrypto', version: '>=1.0.2')
a2x = find_program('a2x', required: get_option('docs'))
jq = find_program('jq', required: false)
mans = []
licenses = ['COPYING']
subdir('include')
subdir('doc')
subdir('lib')
subdir('cmd')
subdir('tests')
install_data(licenses, install_dir: licensedir)
libraries = []
if build_dynamic
libraries += libjose_lib
endif
if build_static
libraries += libjose_static
endif
pkg = import('pkgconfig')
pkg.generate(
description: 'Library for managing JOSE objects',
version: meson.project_version(),
filebase: meson.project_name(),
name: 'José Library',
libraries_private: [ zlib, libcrypto ],
libraries: libraries,
requires: jansson,
)
if a2x.found()
foreach m : mans
custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
install: true
)
endforeach
elif get_option('docs').auto()
warning('Will not build man pages due to missing dependencies!')
endif
if not jq.found()
message('jq not found (unrequired but recommended)')
endif