Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
632 lines (570 loc) · 22.4 KB
/
Copy pathmeson.build
File metadata and controls
632 lines (570 loc) · 22.4 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
project('mistserver', 'cpp', meson_version: '>=1.6.0', default_options: ['cpp_std=c++11'])
add_project_arguments(['-funsigned-char', '-D_LARGEFILE_SOURCE','-Wno-sign-compare', '-Wparentheses', '-Wno-non-virtual-dtor', '-Wno-strict-aliasing'], language: 'cpp')
fs = import('fs')
if host_machine.system() == 'darwin'
add_project_arguments(['-D__APPLE_USE_RFC_3542'], language: 'cpp')
endif
if host_machine.system() == 'cygwin'
add_project_arguments(['-DWIN32_LEAN_AND_MEAN'], language: 'cpp')
endif
# Ensures the "mist" directory is in the include path
incroot = include_directories('.')
# Sets the RELEASE, if not set externally
release = get_option('RELEASE')
if release.contains('DEFAULT')
release = 'Generic_'+target_machine.cpu_family()
endif
release = release.strip()
# Grab version number from git, if available
# Falls back to a file called "VERSION" or the string "Unknown" otherwise
git = find_program('git', required: false)
if git.found()
rv = run_command(git, 'describe', check: false)
version = rv.stdout().strip()
if rv.returncode() != 0
if fs.is_file('VERSION')
version = fs.read('VERSION').strip()
else
version = get_option('VERSION')
endif
endif
else
if fs.is_file('VERSION')
version = fs.read('VERSION').strip()
else
version = get_option('VERSION')
endif
endif
# Handle all options
string_opt = '-D@0@="@1@"'
int_opt = '-D@0@=@1@'
option_defines = [
string_opt.format('APPNAME', get_option('APPNAME')),
int_opt.format('DEBUG', get_option('DEBUG')),
string_opt.format('RELEASE' ,release),
string_opt.format('PACKAGE_VERSION' ,version),
int_opt.format('SHM_DATASIZE', get_option('DATASIZE')),
int_opt.format('STAT_CUTOFF', get_option('STAT_CUTOFF')),
int_opt.format('STATS_DELAY', get_option('STATS_DELAY')),
string_opt.format('UDP_API_HOST' ,get_option('UDP_API_HOST')),
int_opt.format('UDP_API_PORT', get_option('UDP_API_PORT')),
]
if not get_option('NOSHM') and host_machine.system() != 'darwin'
option_defines += '-DSHM_ENABLED=1'
endif
usessl = true
if get_option('NOSSL')
usessl = false
else
option_defines += '-DSSL=1'
endif
if not get_option('NOQUIRC')
option_defines += '-DHASQUIRC=1'
endif
if not get_option('NOUPDATE')
option_defines += '-DUPDATER=1'
endif
if get_option('NOAUTH')
option_defines += '-DNOAUTH=1'
endif
if not get_option('DISKSERIAL').contains('DEFAULT')
option_defines += string_opt.format('DISKSERIAL',get_option('DISKSERIAL'))
endif
if not get_option('FILLER_DATA').contains('DEFAULT')
option_defines += string_opt.format('FILLER_DATA',get_option('FILLER_DATA'))
endif
if not get_option('SHARED_SECRET').contains('DEFAULT')
option_defines += string_opt.format('SHARED_SECRET',get_option('SHARED_SECRET'))
endif
if get_option('WITH_THREADNAMES')
option_defines += '-DWITH_THREADNAMES=1'
endif
if get_option('NOLLHLS')
option_defines += '-DNOLLHLS=1'
endif
if get_option('DOCKERRUN')
option_defines += '-DDOCKERRUN'
endif
# End of options
message('Building release @0@ for version @1@ @ debug level @2@'.format(release, version, get_option('DEBUG')))
# Set dependencies
mist_deps = []
ccpp = meson.get_compiler('cpp')
# libxml2 needed for ONVIF camera discovery (xml.cpp, soap.cpp, device_onvif.cpp)
libxml2 = dependency('libxml-2.0', required: false)
have_libxml2 = libxml2.found()
if ccpp.has_header_symbol('netinet/in.h', 'IPV6_RECVPKTINFO', args:['-D__APPLE_USE_RFC_3542']) and ccpp.has_header_symbol('netinet/in.h', 'IP_PKTINFO', args:['-D__APPLE_USE_RFC_3542'])
option_defines += '-DHASPKTINFO'
endif
if host_machine.system() == 'cygwin'
if ccpp.has_header_symbol('netinet/in.h', 'IPV6_PKTINFO', args:['-DWIN32_LEAN_AND_MEAN']) and ccpp.has_header_symbol('netinet/in.h', 'IP_PKTINFO', args:['-DWIN32_LEAN_AND_MEAN'])
option_defines += '-DHASPKTINFO'
endif
endif
if ccpp.has_header('execinfo.h')
option_defines += '-DHASEXECINFO'
endif
if ccpp.has_header('sys/wait.h')
option_defines += '-DHASSYSWAIT'
endif
if usessl
mbedtls = dependency('mbedtls', required: false, fallback: ['mbedtls', 'mbedtls_dep'])
if mbedtls.type_name() == 'internal'
mbedtls_proj = subproject('mbedtls')
mbedtls = mbedtls_proj.get_variable('mbedtls_dep')
mbedx509 = mbedtls_proj.get_variable('mbedx509_dep')
mbedcrypto = mbedtls_proj.get_variable('mbedcrypto_dep')
else
mbedx509 = ccpp.find_library('mbedx509', required: false)
mbedcrypto = ccpp.find_library('mbedcrypto', required: false)
endif
##This currently only works for MbedTLS < 3
code_upstream = '''
#include <mbedtls/ssl.h>
static mbedtls_ssl_srtp_profile srtp_profiles[] ={MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80, MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32, MBEDTLS_TLS_SRTP_UNSET};
static int test(){
mbedtls_ssl_config ssl_conf;
mbedtls_ssl_conf_dtls_srtp_protection_profiles(&ssl_conf, srtp_profiles);
return 0;
}
'''
# Test if we can compile the way we expect
code_ddvtech = '''
#include <mbedtls/ssl.h>
mbedtls_ssl_srtp_profile srtp_profiles[]={MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80, MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_32};
static int test(){
mbedtls_ssl_config ssl_conf;
mbedtls_ssl_conf_dtls_srtp_protection_profiles(&ssl_conf, srtp_profiles, sizeof(srtp_profiles) / sizeof(srtp_profiles[0]));
return 0;
}
'''
if mbedtls.type_name() == 'internal'
have_upstream_mbedtls_srtp = true
else
have_upstream_mbedtls_srtp = ccpp.compiles(code_upstream, dependencies: [mbedtls, mbedx509, mbedcrypto], name: 'MbedTLS SRTP is upstream')
if not have_upstream_mbedtls_srtp
ddvtech_mbedtls = ccpp.compiles(code_ddvtech, dependencies: [mbedtls, mbedx509, mbedcrypto], name: 'MbedTLS is DDVTech fork')
if not mbedtls.found() or not ddvtech_mbedtls
have_upstream_mbedtls_srtp = true
mbedtls_proj = subproject('mbedtls')
mbedtls = mbedtls_proj.get_variable('mbedtls_dep')
mbedx509 = mbedtls_proj.get_variable('mbedx509_dep')
mbedcrypto = mbedtls_proj.get_variable('mbedcrypto_dep')
# Make nested fallbacks such as libsrtp2 consume the same bundled MbedTLS.
# Otherwise they may rediscover the system MbedTLS and put both versions
# on every executable's link line, causing duplicate symbols.
meson.override_dependency('mbedtls', mbedtls)
endif
endif
endif
option_defines += int_opt.format('HAVE_UPSTREAM_MBEDTLS_SRTP', have_upstream_mbedtls_srtp.to_int())
mist_deps += [mbedtls, mbedx509, mbedcrypto]
mist_deps += dependency('libsrtp2', default_options: ['tests=disabled', 'crypto-library=mbedtls'], fallback: ['libsrtp2', 'libsrtp2_dep'])
usrsctp_dep = false
if not get_option('NOUSRSCTP') and host_machine.system() != 'cygwin'
usrsctp_dep = dependency('usrsctp', fallback: ['usrsctp', 'usrsctp_dep'])
endif
have_usrsctp = not get_option('NOUSRSCTP') and host_machine.system() != 'cygwin' and usrsctp_dep.found()
if have_usrsctp
option_defines += '-DWITH_DATACHANNELS'
endif
endif
libsrt = false
libsrt_has_shutdown = false
if not get_option('NOSRT')
libsrt = dependency('srt', required: false)
if libsrt.found()
# Compiler feature checks only accept external dependencies. Keep this check
# on the system dependency before the fallback can replace it with Meson's
# internal DependencyHolder.
libsrt_has_shutdown = ccpp.has_header_symbol(
'srt/srt.h', 'SRTS_SHUTDOWN', dependencies: libsrt)
else
libsrt_proj = subproject('libsrt', default_options: ['default_library=static'])
libsrt = libsrt_proj.get_variable('srt_dep')
# The pinned 1.5.6 fallback declares SRTS_SHUTDOWN and implements the state
# in srtcore/api.cpp; its compile is the feature check.
libsrt_has_shutdown = true
endif
endif
have_srt = not get_option('NOSRT') and libsrt.found()
if have_srt
option_defines += '-DWITH_SRT'
if libsrt_has_shutdown
option_defines += '-DHAVE_SRTS_SHUTDOWN'
endif
endif
librist = false
if not get_option('NORIST')
librist = dependency('librist', fallback: ['librist', 'librist_dep'], default_options:['test=false', 'built_tools=false'])
endif
have_librist = not get_option('NORIST') and librist.found()
av_libs = []
if get_option('WITH_AV')
# Keep the fallback build intentional and reproducible: this is the codec/filter
# contract for all WITH_AV targets, including MistProcAV, MistInAV, MistProcThumbs,
# and MistOutJPEGReceiver. System FFmpeg dependencies ignore these options; they
# only apply when Meson enters the pinned FFmpeg subproject.
ffmpeg_opts = [
'prefer_static=true',
'auto_features=disabled',
'gpl=enabled',
'version3=enabled',
'protocols=enabled',
'demuxers=enabled',
'muxers=enabled',
'bsfs=enabled',
'parsers=enabled',
'filters=enabled',
'libmp3lame=enabled',
'libmp3lame_encoder=enabled',
'libopus=enabled',
'libopus_decoder=enabled',
'libopus_encoder=enabled',
'libvpx=enabled',
'libvpx_vp8_decoder=enabled',
'libvpx_vp8_encoder=enabled',
'libvpx_vp9_decoder=enabled',
'libvpx_vp9_encoder=enabled',
'libx264=enabled',
'libx264_encoder=enabled',
'libx265=enabled',
'libx265_encoder=enabled',
'libdav1d=enabled',
'libdav1d_decoder=enabled',
'libaom=enabled',
'libaom_av1_decoder=enabled',
'libaom_av1_encoder=enabled',
'libsvtav1=enabled',
'libsvtav1_encoder=enabled',
'h264_parser=enabled',
'h264_muxer=enabled',
'h264_demuxer=enabled',
'h264_decoder=enabled',
'hevc_parser=enabled',
'hevc_demuxer=enabled',
'hevc_decoder=enabled',
'av1_decoder=enabled',
'av1_demuxer=enabled',
'av1_parser=enabled',
'vp8_decoder=enabled',
'vp9_decoder=enabled',
'vp9_parser=enabled',
'mjpeg_decoder=enabled',
'mjpeg_encoder=enabled',
'mjpeg_demuxer=enabled',
'mjpeg_muxer=enabled',
'aac_decoder=enabled',
'aac_encoder=enabled',
'aac_parser=enabled',
'opus_decoder=enabled',
'opus_encoder=enabled',
'opus_parser=enabled',
'mp3_decoder=enabled',
'mp3float_decoder=enabled',
'flac_decoder=enabled',
'flac_encoder=enabled',
'vorbis_decoder=enabled',
'vorbis_encoder=enabled',
'pcm_s16be_decoder=enabled',
'pcm_s16be_encoder=enabled',
'pcm_s32be_decoder=enabled',
'pcm_s32be_encoder=enabled',
'rawvideo_decoder=enabled',
'rawvideo_encoder=enabled',
'vsrc_buffer_filter=enabled',
'vsink_buffer_filter=enabled',
'scale_filter=enabled',
'format_filter=enabled',
'aresample_filter=enabled',
'decklink=disabled',
'decklink_indev=disabled',
'decklink_outdev=disabled',
]
av_libs += dependency('libswscale', fallback: ['ffmpeg', 'libswscale_dep'], default_options: ffmpeg_opts)
av_libs += dependency('libavformat', fallback: ['ffmpeg', 'libavformat_dep'], default_options: ffmpeg_opts)
av_libs += dependency('libavcodec', fallback: ['ffmpeg', 'libavcodec_dep'], default_options: ffmpeg_opts)
av_libs += dependency('libavutil', fallback: ['ffmpeg', 'libavutil_dep'], default_options: ffmpeg_opts)
av_libs += dependency('libswresample', fallback: ['ffmpeg', 'libswresample_dep'], default_options: ffmpeg_opts)
av_libs += dependency('libavfilter', fallback: ['ffmpeg', 'libavfilter_dep'], default_options: ffmpeg_opts)
endif
onnx_libs = []
onnx_defines = []
onnx_opt = get_option('ONNX')
onnx_static = get_option('ONNX_STATIC')
onnx_profile = get_option('ONNX_PROFILE')
onnx_required = onnx_opt.enabled()
onnxruntime_dep = dependency('libonnxruntime', 'onnxruntime',
required: onnx_required, static: onnx_static)
onnxruntime_usable = onnxruntime_dep.found()
if onnxruntime_dep.found() and onnx_static
onnxruntime_libdir = onnxruntime_dep.get_variable(pkgconfig: 'libdir', default_value: '')
if onnxruntime_libdir == '' or not fs.is_file(onnxruntime_libdir / 'libonnxruntime.a')
onnxruntime_usable = false
if onnx_required
error('ONNX_STATIC=true requires a real libonnxruntime.a archive')
endif
warning('No static ONNX Runtime archive was found; disabling ONNX')
endif
onnxruntime_static_probe = '''
#include <onnxruntime_c_api.h>
int main() {
const OrtApiBase *base = OrtGetApiBase();
return base && base->GetApi(ORT_API_VERSION) ? 0 : 1;
}
'''
if onnxruntime_usable and not ccpp.links(onnxruntime_static_probe,
dependencies: onnxruntime_dep, args: '-std=c++17',
name: 'ONNX Runtime static dependency closure')
onnxruntime_usable = false
if onnx_required
error('Static ONNX Runtime dependency metadata has an incomplete link closure')
endif
warning('Static ONNX Runtime dependency metadata has an incomplete link closure; disabling ONNX')
endif
endif
# OpenCV 5 renamed its pkg-config file while retaining the component libraries. Probe
# both names and request exactly the modules used by libmistonnx. In particular,
# videoio was never used; imgcodecs, video and geometry are.
opencv_modules = ['core', 'imgproc', 'imgcodecs', 'video', 'geometry']
opencv_dep = dependency('opencv4', modules: opencv_modules,
required: false, static: onnx_static)
if not opencv_dep.found()
opencv_dep = dependency('opencv5', modules: opencv_modules,
required: onnx_required, static: onnx_static)
endif
# Some packages (notably Homebrew OpenCV 5) install static archives but omit their
# TIFF/WebP/PNG/LAPACK closure from pkg-config's Libs.private. Detect that packaging
# failure at configure time and fall back to the complete shared dependency rather
# than accepting ONNX support that can compile but never link.
opencv_static_usable = onnx_static
if opencv_dep.found() and onnx_static
opencv_libdir = opencv_dep.get_variable(pkgconfig: 'libdir', default_value: '')
foreach module: opencv_modules
if opencv_libdir == '' or not fs.is_file(opencv_libdir / ('libopencv_' + module + '.a'))
opencv_static_usable = false
endif
endforeach
if not opencv_static_usable and onnx_required
error('ONNX_STATIC=true requires real static archives for every requested OpenCV module')
endif
opencv_static_probe = '''
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/video/tracking.hpp>
#include <vector>
int main() {
cv::Mat image(2, 2, CV_8UC3);
std::vector<unsigned char> encoded;
cv::imencode(".png", image, encoded);
cv::KalmanFilter filter(2, 1);
return encoded.empty() || filter.statePre.empty();
}
'''
if not opencv_static_usable or not ccpp.links(opencv_static_probe, dependencies: opencv_dep,
name: 'OpenCV static dependency closure')
if onnx_required
error('Static OpenCV dependency metadata has an incomplete link closure')
endif
warning('Static OpenCV dependency metadata is incomplete; using shared OpenCV for ONNX')
opencv_dep = dependency('opencv4', modules: opencv_modules,
required: false, static: false)
if not opencv_dep.found()
opencv_dep = dependency('opencv5', modules: opencv_modules,
required: onnx_required, static: false)
endif
opencv_static_usable = false
endif
endif
have_onnx = not onnx_opt.disabled() and onnxruntime_usable and opencv_dep.found()
if have_onnx
onnx_libs += [onnxruntime_dep, opencv_dep]
onnx_defines += '-DMIST_ONNX_PROFILE="@0@"'.format(onnx_profile)
if onnx_static
onnx_defines += '-DMIST_ONNX_STATIC=1'
endif
message('ONNX support enabled (profile=@0@, static requested=@1@, OpenCV static=@2@)'.format(
onnx_profile, onnx_static, opencv_static_usable))
else
missing = []
if not onnxruntime_usable
missing += 'onnxruntime'
endif
if not opencv_dep.found()
missing += 'opencv4'
endif
if onnx_opt.disabled()
message('ONNX support disabled by -DONNX=disabled')
else
message('ONNX support disabled (missing: @0@)'.format(', '.join(missing)))
endif
endif
# Add thread dependency since we always have thread code in libmist
mist_deps += dependency('threads')
# Add rt dependency when using shared memory
if not get_option('NOSHM') and host_machine.system() != 'darwin'
mist_deps += ccpp.find_library('rt', required : true)
endif
#
if host_machine.system() == 'cygwin'
option_defines += ['-D_POSIX_C_SOURCE=200112L', '-D_GNU_SOURCE', '-D_TTHREAD_POSIX_', '-D_TTHREAD_PLATFORM_DEFINED_']
option_defines += '-D_GNU_SOURCE'
endif
# Add defines for size_t for platforms where is not equivalent to uint32_t or uint64_t
code_sizet_needed = '''
#include <stdint.h>
#include <sys/types.h>
class A {
public:
A(){}
A(const char*){}
A(int32_t){}
A(int64_t){}
A(uint32_t){}
A(uint64_t){}
A(size_t){}
A(double){}
};
A tmp;
'''
if ccpp.compiles(code_sizet_needed, name: 'Check if JSON class needs size_t variants')
option_defines += '-DSIZET_VARIANT'
endif
# NDI support via runtime dynamic loading.
# For our targets (Linux/macOS server) the NDI SDK ships no static library - only the dynamic
# libndi.so.6 / libndi.dylib (static archives exist only for iOS/tvOS) - and load-time linking
# would add a hard libndi dependency (breaking our static release binaries), so we vendor the
# MIT-licensed SDK headers under lib/ndi/include and dlopen the runtime through the SDK loader
# table (see lib/device_ndi.cpp). Support is compiled in unless -DNONDI is set; it degrades to a
# no-op when the NDI runtime is not installed on the host. Only libdl is needed to link.
have_ndi = not get_option('NONDI')
ndi_deps = []
if have_ndi
# dlopen/dlsym live in libc on glibc >= 2.34 and in libSystem on macOS; only add an
# explicit -ldl on older systems. Avoiding a needless -ldl keeps libdl.so out of the
# static release binaries' NEEDED list (the release verifier only allows libc/libm/etc.).
if not ccpp.has_function('dlopen')
ndi_libdl = ccpp.find_library('dl', required: false)
if ndi_libdl.found()
ndi_deps += ndi_libdl
endif
endif
endif
ndi_sdk_dep = declare_dependency(
include_directories: include_directories('lib/ndi/include'),
dependencies: ndi_deps,
)
if have_ndi
option_defines += '-DWITH_NDI'
endif
if have_libxml2
option_defines += '-DWITH_ONVIF'
endif
add_project_arguments(option_defines, language: 'cpp')
# V4L2 detection (used in src/input/meson.build and feature summary)
have_v4l2 = ccpp.has_header('linux/videodev2.h')
# Set build targets
executables = []
# Web sources
subdir('lsp')
subdir('generated')
# libmist
subdir('lib')
subdir('mist')
# Binaries
subdir('src')
exec_tgts = {}
## This makes sure all (installable) executables are build in top level directory
## Done because MistController expects its binaries to all be in the same directory
foreach exec : executables
exec_override_options = []
if exec.has_key('override_options')
exec_override_options = exec.get('override_options')
endif
exec_tgts += { exec.get('name'): executable(
exec.get('name'),
exec.get('sources'),
dependencies: exec.get('deps'),
cpp_args: exec.get('defines'),
override_options: exec_override_options,
install: true,
) }
endforeach
# Ship the ONNX model-provisioning scripts next to the binaries (same dir MistController
# expects its siblings in), so MistProcONNX can locate and run them at runtime via
# Util::getMyPath(). Installed under the prefix, so the Docker image's `COPY /usr/local/`
# picks them up automatically. Only relevant when ONNX support is built.
if have_onnx
install_data(
['scripts/ONNX/prepare_models.sh', 'scripts/ONNX/export_models.py'],
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x',
)
install_data(
['scripts/ONNX/README.md', 'scripts/ONNX/RELEASE_CHECKLIST.md',
'scripts/ONNX/AGPL_DISTRIBUTION.md',
'scripts/ONNX/dependencies.lock.tsv', 'scripts/ONNX/models.manifest.tsv'],
install_dir: get_option('bindir'),
install_mode: 'rw-r--r--',
)
endif
# Tests may use names in exec_tgts so we load it last
subdir('test')
# Docs
doxygen = find_program('doxygen', required: false)
if doxygen.found()
doxyfile = configure_file(output: 'Doxyfile', input: 'Doxyfile.in', configuration: {
'PACKAGE_VERSION': version,
'RELEASE' : release,
'DOXY_LAYOUT': meson.project_source_root() + '/DoxygenLayout.xml',
'INPUT_DIRS': meson.project_source_root() + '/src ' + meson.project_source_root() + '/lib',
})
run_target('docs', command: [doxygen, doxyfile])
endif
# Feature summary (printed last so all detection is complete)
# WebRTC data channels depend on both SSL and usrsctp
webrtc_dc_status = 'NO (requires SSL)'
if usessl
webrtc_dc_status = have_usrsctp ? 'YES' : 'NO (disabled: -DNOUSRSCTP=true)'
endif
# RIST reason
rist_status = 'YES'
if get_option('NORIST')
rist_status = 'NO (disabled: -DNORIST=true)'
elif not have_librist
rist_status = 'NO (librist not found)'
endif
# SRT reason
srt_status = 'YES'
if get_option('NOSRT')
srt_status = 'NO (disabled: -DNOSRT=true)'
elif not have_srt
srt_status = 'NO (libsrt not found)'
endif
message('')
message('Feature summary')
message('===============')
message('')
message(' Codecs & Processing')
message(' libav (FFmpeg): ' + (get_option('WITH_AV') ? 'YES' : 'NO (enable: -DWITH_AV=true)'))
message(' ONNX AI processing: ' + (have_onnx ? 'YES (profile=' + onnx_profile + ')' : 'NO'))
message('')
message(' Devices & Discovery')
message(' NDI: ' + (have_ndi ? 'COMPILED (runtime resolved and reported at startup)' : 'NO (disabled via -DNONDI)'))
message(' ONVIF camera discovery: ' + (have_libxml2 ? 'YES' : 'NO (libxml2 not found)'))
message(' V4L2 capture: ' + (have_v4l2 ? 'YES' : 'NO (linux/videodev2.h not found)'))
message('')
message(' Protocols')
message(' LLHLS: ' + (not get_option('NOLLHLS') ? 'YES' : 'NO (disabled: -DNOLLHLS=true)'))
message(' RIST: ' + rist_status)
message(' SRT: ' + srt_status)
message(' SSL/TLS: ' + (usessl ? 'YES' : 'NO (disabled: -DNOSSL=true)'))
message(' WebRTC data channels: ' + webrtc_dc_status)
message('')
message(' System')
message(' Auth: ' + (not get_option('NOAUTH') ? 'YES' : 'NO (disabled: -DNOAUTH=true)'))
message(' Load balancer: ' + (get_option('LOAD_BALANCE') ? 'YES (WIP)' : 'NO (enable: -DLOAD_BALANCE=true)'))
message(' QR code (quirc): ' + (not get_option('NOQUIRC') ? 'YES' : 'NO (disabled: -DNOQUIRC=true)'))
message(' Shared memory: ' + (not get_option('NOSHM') ? 'YES' : 'NO (disabled: -DNOSHM=true)'))
message(' Updater: ' + (not get_option('NOUPDATE') ? 'YES' : 'NO (disabled: -DNOUPDATE=true)'))
message('')