This repository has been archived by the owner on Sep 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
meson.build
80 lines (63 loc) · 2.56 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
project('chamge', 'c',
version: '0.10.1',
license: 'Apache-2.0',
meson_version: '>= 0.40',
default_options: [ 'warning_level=1',
'buildtype=debug' ])
project_version = meson.project_version()
version_arr = project_version.split('.')
project_version_major = version_arr[0].to_int()
project_version_minor = version_arr[1].to_int()
project_version_micro = version_arr[2].to_int()
apiversion = '1.0'
soversion = 0
curversion = project_version_minor * 100 + project_version_micro
libversion = '@0@.@[email protected]'.format(soversion, curversion)
chamge_api_name = '@0@-@1@'.format(meson.project_name(), apiversion)
prefix = get_option('prefix')
cc = meson.get_compiler('c')
cdata = configuration_data()
cdata.set_quoted('PACKAGE_STRING', meson.project_name())
cdata.set_quoted('PACKAGE_NAME', meson.project_name())
cdata.set_quoted('PACKAGE', meson.project_name())
cdata.set_quoted('VERSION', meson.project_version())
# TODO: Check host_system
cdata.set('_CHAMGE_EXTERN', '__attribute__((visibility("default"))) extern')
cdata.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
configure_file(output : 'config.h', configuration : cdata)
# Dependencies
glib_req_version = '>= 2.44.0'
gst_req_version = '>= 1.16.0'
glib_dep = dependency('glib-2.0', version: glib_req_version,
fallback: ['glib', 'libglib_dep'])
gio_dep = [dependency('gio-2.0', version: glib_req_version,
fallback: ['glib', 'libgio_dep']),
dependency('gio-unix-2.0', version: glib_req_version,
fallback: ['glib', 'libgio_dep'])]
gobject_dep = dependency('gobject-2.0', version: glib_req_version,
fallback: ['glib', 'libgobject_dep'])
# meson fails to get dependency if `pkg-config --cflags` returns zero
r = run_command('pkg-config', '--version')
pkgconfig_version = r.stdout().strip()
if pkgconfig_version.version_compare('> 0.29.1')
rabbitmq_dep = dependency('librabbitmq', version: '>= 0.7.0')
else
rabbitmq_dep = declare_dependency(link_args: ['-lrabbitmq'])
endif
json_glib_dep = dependency ('json-glib-1.0', version: '>= 1.1.2')
gnome = import('gnome')
chamge_incs = include_directories('.', 'chamge', 'glib-compat')
chamge_doc_incs = include_directories('chamge', 'chamge/dbus')
common_ldflags = [ ]
subdir('glib-compat')
subdir('chamge')
subdir('hwangsaeul')
subdir('agent')
subdir('tests')
subdir('examples')
subdir('doc')
if meson.version().version_compare('>= 0.46.0')
python3 = import('python').find_installation()
run_command(python3, '-c',
'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
endif