-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
meson.build
189 lines (159 loc) · 6.84 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
project('jami-daemon', ['c', 'cpp'],
version: '15.3.0',
license: 'GPL3+',
default_options: ['cpp_std=gnu++17', 'buildtype=debugoptimized'],
meson_version:'>= 0.56'
)
modpkgconfig = import('pkgconfig')
if host_machine.system() == 'darwin'
add_languages('objcpp')
endif
#################################################
# Required dependencies
#################################################
depthreads = dependency('threads')
depopendht = dependency('opendht', version: '>= 2.1.0')
depdhtnet = dependency('dhtnet')
depgnutls = dependency('gnutls', version: '>= 3.6.7')
depnettle = dependency('nettle', version: '>= 3.0.0')
deplibpjproject = dependency('libpjproject') # a custom fork, see contrib/src/pjproject/rules.mak
deplibgit2 = dependency('libgit2', version: '>= 1.1.0')
deplibsecp256k1 = dependency('libsecp256k1', version: '>= 0.1')
deplibavcodec = dependency('libavcodec', version: '>= 56.60.100')
deplibavfilter = dependency('libavfilter', version: '>= 5.40.101')
deplibavdevice = dependency('libavdevice', version: '>= 56.4.100')
deplibavformat = dependency('libavformat', version: '>= 56.40.101')
deplibswscale = dependency('libswscale', version: '>= 3.1.101')
deplibswresample = dependency('libswresample', version: '>= 1.2.101')
deplibavutil = dependency('libavutil', version: '>= 55.75.100')
depfmt = dependency('fmt', version: '>= 5.3')
depyamlcpp = dependency('yaml-cpp', version: '>= 0.5.1')
depjsoncpp = dependency('jsoncpp', version: '>= 1.6.5')
depzlib = dependency('zlib')
if get_option('interfaces').contains('dbus')
depsdbuscpp = dependency('sdbus-c++', version: '>= 1.2.0')
progsdbuscppxml2cpp = find_program('sdbus-c++-xml2cpp', native: true)
endif
if get_option('interfaces').contains('nodejs')
progswig = find_program('swig', native: true)
prognodegyp = find_program('node-gyp', native: true)
endif
if get_option('tests')
depcppunit = dependency('cppunit', version: '>= 1.12')
endif
#################################################
# Optional dependencies and configuration
#################################################
progpod2man = find_program('pod2man', native: true, required: false)
conf = configuration_data()
conf.set_quoted('PACKAGE', 'jami')
conf.set_quoted('PACKAGE_NAME', 'Jami Daemon')
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('PACKAGE_STRING', 'Jami Daemon ' + meson.project_version())
conf.set_quoted('JAMI_DATADIR', get_option('datadir') / 'jami')
depopensl = meson.get_compiler('cpp').find_library('OpenSLES', has_headers: 'SLES/OpenSLES.h', required: get_option('opensl'))
conf.set10('HAVE_OPENSL', depopensl.found())
depalsa = dependency('alsa', version: '>= 1.0', required: get_option('alsa'))
conf.set10('HAVE_ALSA', depalsa.found())
deplibpulse = dependency('libpulse', version: '>= 0.9.15', required: get_option('pulseaudio'))
conf.set10('HAVE_PULSE', deplibpulse.found())
depjack = dependency('jack', required: get_option('jack'))
conf.set10('HAVE_JACK', depjack.found())
depportaudio = dependency('portaudio-2.0', required: get_option('portaudio'))
conf.set10('HAVE_PORTAUDIO', depportaudio.found())
depopenssl = dependency('openssl', required: get_option('name_service'))
conf.set10('HAVE_RINGNS', depopenssl.found())
depwebrtcap = dependency('webrtc-audio-processing', required: get_option('webrtc_ap'))
conf.set10('HAVE_WEBRTC_AP', depwebrtcap.found())
depspeexdsp = dependency('speexdsp', required: get_option('speex_ap'))
conf.set10('HAVE_SPEEXDSP', depspeexdsp.found())
if get_option('video')
conf.set('ENABLE_VIDEO', true)
if host_machine.system() == 'linux' and meson.get_compiler('cpp').get_define('__ANDROID__') != '1'
deplibudev = dependency('libudev')
endif
if get_option('hw_acceleration')
conf.set('RING_ACCEL', true)
conf.set('ENABLE_VIDEOTOOLBOX', host_machine.system() == 'darwin')
else
conf.set('RING_ACCEL', false)
conf.set('ENABLE_VIDEOTOOLBOX', false)
endif
else
conf.set('ENABLE_VIDEO', false)
conf.set('RING_ACCEL', false)
conf.set('ENABLE_VIDEOTOOLBOX', false)
endif
if get_option('plugins')
conf.set('ENABLE_PLUGIN', true)
if host_machine.system() == 'darwin'
depminizip = dependency('minizip', version: '>= 3.0.0')
else
deplibarchive = dependency('libarchive', version: '>= 3.4.0')
endif
depdl = meson.get_compiler('cpp').find_library('dl', required: false)
else
conf.set('ENABLE_PLUGIN', false)
endif
if get_option('tracepoints')
conf.set('ENABLE_TRACEPOINTS', true)
deplttngust = dependency('lttng-ust', version: '>= 2.13')
else
conf.set('ENABLE_TRACEPOINTS', false)
endif
conf.set10('HAVE_COREAUDIO', host_machine.system() == 'darwin')
conf.set('ENABLE_SHM', get_option('interfaces').contains('dbus'))
configure_file(
output: 'config.h',
configuration: conf
)
add_project_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp'])
#################################################
# Build targets
#################################################
add_project_arguments('-DLIBJAMI_BUILD', language: ['c', 'cpp'])
if get_option('default_library') != 'static'
add_project_arguments('-Djami_EXPORTS', language: ['c', 'cpp'])
endif
add_project_arguments('-DASIO_STANDALONE', language: ['c', 'cpp'])
add_project_arguments('-DMSGPACK_NO_BOOST', language: ['c', 'cpp'])
subdir('src')
if get_option('interfaces').contains('dbus')
subdir('bin' / 'dbus')
endif
if get_option('interfaces').contains('nodejs')
subdir('bin' / 'nodejs')
endif
if get_option('tests')
subdir('test')
endif
#################################################
# Resources and metafiles
#################################################
subdir('ringtones')
if host_machine.system() == 'linux' and meson.get_compiler('cpp').get_define('__ANDROID__') != '1'
provides_content = ''
if get_option('interfaces').contains('dbus')
provides_content += ' <dbus type="user">cx.ring.Ring</dbus>'
endif
if get_option('interfaces').contains('library')
provides_content += (provides_content == '')? '' : '\n'
if get_option('default_library') == 'static'
provides_content += ' <library>libjami.a</library>'
elif get_option('default_library') == 'shared'
provides_content += ' <library>libjami.so</library>'
else
provides_content += ' <library>libjami.so</library>\n'
provides_content += ' <library>libjami.a</library>'
endif
endif
if provides_content != ''
configure_file(
configuration: {'PROVIDES_CONTENT': provides_content},
input: 'net.jami.daemon.metainfo.xml.in',
output: 'net.jami.daemon.metainfo.xml',
install: true,
install_dir: get_option('datadir') / 'metainfo'
)
endif
endif