forked from meduketto/iksemel
-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
76 lines (57 loc) · 1.87 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
project('iksemel','c',
default_options : ['warning_level=3'],
license: 'LGPL2.1+',
meson_version: '>= 0.50.0',
)
# Iksemel specific declarations
version = get_option('version')
package_name = get_option('package_name')
package_url = get_option('package_url')
package_bugreport_url = get_option('package_bugreport_url')
cc = meson.get_compiler('c')
host_system = host_machine.system()
# compiler flags
common_flags = [
'-DSTDC_HEADERS',
'-DHAVE_CONFIG_H',
]
add_project_arguments(common_flags, language: 'c')
cflags = cc.get_supported_arguments(['-Werror=implicit-function-declaration'])
# Possibly can add new flags like '-Werror=declaration-after-statement'
add_project_arguments(cflags, language: 'c')
if get_option('gnutls').enabled()
if get_option('openssl').enabled()
error('You cannot use gnutls and openssl at the same time for Jabber support.')
endif
endif
# Add indispensable subdirectories
include_dir = include_directories('include')
subdir('include')
subdir('src')
# Add Tests
if get_option('tests')
subdir('test')
endif
# Add Python Bindings
if get_option('with_python')
py_include_dir = include_directories('python')
subdir('python')
endif
# Add Tools
if get_option('with_tools')
subdir('tools')
endif
# Write pkgconfig
pkgconf = configuration_data()
pkgconf.set('prefix', join_paths(get_option('prefix')))
pkgconf.set('exec_prefix', '${prefix}')
pkgconf.set('includedir', join_paths('${prefix}', get_option('includedir')))
pkgconf.set('libdir', join_paths('${prefix}', get_option('libdir')))
pkgconf.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
pkgconf.set('datadir', '${datarootdir}')
pkgconf.set('VERSION', version)
pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
configure_file(input : 'iksemel.pc.in',
output : 'iksemel-@[email protected]'.format(version),
configuration : pkgconf,
install_dir : pkg_install_dir)