1 if nnfw_runtime_support_is_available
2 filter_sub_nnfw_sources = ['tensor_filter_nnfw.c']
4 nnstreamer_filter_nnfw_deps = [nnfw_runtime_support_deps, nnstreamer_single_dep]
6 # Check old function (@todo remove this definition later, nnfw ver >= 1.6.0)
7 if not cc.has_header_symbol('nnfw/nnfw.h', 'nnfw_set_input_tensorinfo', dependencies: nnfw_dep)
8 nnstreamer_filter_nnfw_deps += declare_dependency(compile_args: ['-DNNFW_USE_OLD_API=1'])
11 nnfw_plugin_lib = shared_library('nnstreamer_filter_nnfw',
12 filter_sub_nnfw_sources,
13 dependencies: nnstreamer_filter_nnfw_deps,
15 install_dir: filter_subplugin_install_dir
17 static_library('nnstreamer_filter_nnfw',
18 filter_sub_nnfw_sources,
19 dependencies: nnstreamer_filter_nnfw_deps,
21 install_dir: nnstreamer_libdir
24 nnfw_plugin_dep = declare_dependency(link_with: nnfw_plugin_lib,
25 dependencies: nnstreamer_filter_nnfw_deps)
28 if armnn_support_is_available
29 filter_sub_armnn_sources = [
30 'tensor_filter_armnn.cc'
33 if cxx.has_header('armnnCaffeParser/ICaffeParser.hpp')
34 armnn_caffeparserlib = cxx.find_library('armnnCaffeParser', required: true)
35 armnn_caffe_dep = declare_dependency(compile_args: '-DENABLE_ARMNN_CAFFE=1')
36 armnn_support_deps = armnn_support_deps + [ armnn_caffe_dep, armnn_caffeparserlib ]
37 message('ARMNN subplugin is built with Caffe parser.')
39 if cxx.has_header('armnnTfLiteParser/ITfLiteParser.hpp')
40 armnn_tflparserlib = cxx.find_library('armnnTfLiteParser', required: true)
41 armnn_tfl_dep = declare_dependency(compile_args: '-DENABLE_ARMNN_TFLITE=1')
42 armnn_support_deps = armnn_support_deps + [ armnn_tfl_dep, armnn_tflparserlib ]
43 message('ARMNN subplugin is built with TFLite parser.')
46 nnstreamer_filter_armnn_deps = [armnn_support_deps, glib_dep, nnstreamer_single_dep]
48 armnn_plugin_lib = shared_library('nnstreamer_filter_armnn',
49 filter_sub_armnn_sources,
50 dependencies: nnstreamer_filter_armnn_deps,
52 install_dir: filter_subplugin_install_dir
54 static_library('nnstreamer_filter_armnn',
55 filter_sub_armnn_sources,
56 dependencies: nnstreamer_filter_armnn_deps,
58 install_dir: nnstreamer_libdir
61 armnn_plugin_dep = declare_dependency(link_with: armnn_plugin_lib,
62 dependencies: nnstreamer_filter_armnn_deps)
65 tf_ver_dep = disabler()
66 if tf_support_is_available
67 tf_ver = tf_support_deps[0].version()
68 tf_ver_major = tf_ver.split('.')[0]
69 tf_ver_minor = tf_ver.split('.')[1]
70 tf_ver_micro = tf_ver.split('.')[2]
72 tf_ver_dep = declare_dependency (
74 '-DTF_VERSION=' + tf_ver,
75 '-DTF_VERSION_MAJOR=' + tf_ver_major,
76 '-DTF_VERSION_MINOR=' + tf_ver_minor,
77 '-DTF_VERSION_MICRO=' + tf_ver_micro,
80 message('TensorFlow version: ' + tf_ver)
82 filter_sub_tf_sources = ['tensor_filter_tensorflow.cc']
84 nnstreamer_filter_tf_deps = [tf_support_deps, nnstreamer_single_dep]
85 nnstreamer_filter_tf_deps += tf_ver_dep
87 shared_library('nnstreamer_filter_tensorflow',
88 filter_sub_tf_sources,
89 dependencies: nnstreamer_filter_tf_deps,
91 install_dir: filter_subplugin_install_dir
94 static_library('nnstreamer_filter_tensorflow',
95 filter_sub_tf_sources,
96 dependencies: nnstreamer_filter_tf_deps,
98 install_dir: nnstreamer_libdir
102 tflite_ver_dep = disabler()
103 if tflite_support_is_available
104 tflite_ver = tflite_support_deps[0].version()
105 tflite_ver_major = tflite_ver.split('.')[0]
106 tflite_ver_minor = tflite_ver.split('.')[1]
107 tflite_ver_micro = tflite_ver.split('.')[2]
109 tflite_ver_dep = declare_dependency (
111 '-DTFLITE_VERSION=' + tflite_ver,
112 '-DTFLITE_VERSION_MAJOR=' + tflite_ver_major,
113 '-DTFLITE_VERSION_MINOR=' + tflite_ver_minor,
114 '-DTFLITE_VERSION_MICRO=' + tflite_ver_micro,
117 message('TensorFlow-lite version: ' + tflite_ver)
119 if not get_option('skip-tflite-flatbuf-check') and not flatbuf_support_is_available
120 flatbuf_dep = dependency('flatbuffers', required : true, \
121 not_found_message : 'flatbuf devel package should be install to build the tensorflow lite subplugin.')
124 filter_sub_tflite_sources = ['tensor_filter_tensorflow_lite.cc']
126 nnstreamer_filter_tflite_deps = [tflite_support_deps, thread_dep, libdl_dep, glib_dep, nnstreamer_single_dep]
128 # Since tf-1.13, tflite has moved from contrib to core
129 tflite_h_prefix='#include <tensorflow/lite/model.h>'
130 if tflite_ver_minor.to_int() < 13
131 tflite_h_prefix='#include <tensorflow/contrib/lite/model.h>'
134 tflite_compile_args = ['-DTFLITE_SUBPLUGIN_NAME="tensorflow1-lite"']
135 if cxx.has_type('kTfLiteInt8', prefix : tflite_h_prefix)
136 tflite_compile_args += '-DTFLITE_INT8=1'
138 if cxx.has_type('kTfLiteInt16', prefix : tflite_h_prefix)
139 tflite_compile_args += '-DTFLITE_INT16=1'
141 if cxx.has_type('kTfLiteFloat16', prefix : tflite_h_prefix)
142 tflite_compile_args += '-DTFLITE_FLOAT16=1'
144 if cxx.has_type('kTfLiteComplex64', prefix : tflite_h_prefix)
145 tflite_compile_args += '-DTFLITE_COMPLEX64=1'
148 tflite_extra_dep = declare_dependency(
149 compile_args : tflite_compile_args
152 nnstreamer_filter_tflite_deps += tflite_extra_dep
153 nnstreamer_filter_tflite_deps += tflite_ver_dep
155 shared_library('nnstreamer_filter_tensorflow1-lite',
156 filter_sub_tflite_sources,
157 dependencies: nnstreamer_filter_tflite_deps,
159 install_dir: filter_subplugin_install_dir
162 static_library('nnstreamer_filter_tensorflow1-lite',
163 filter_sub_tflite_sources,
164 dependencies: nnstreamer_filter_tflite_deps,
166 install_dir: nnstreamer_libdir
170 tflite2_ver_dep = disabler()
171 if tflite2_support_is_available
172 tflite2_ver = tflite2_support_deps[0].version()
173 tflite2_ver_major = tflite2_ver.split('.')[0]
174 tflite2_ver_minor = tflite2_ver.split('.')[1]
175 tflite2_ver_micro = tflite2_ver.split('.')[2]
177 tflite2_ver_dep = declare_dependency (
179 '-DTFLITE_VERSION=' + tflite2_ver,
180 '-DTFLITE_VERSION_MAJOR=' + tflite2_ver_major,
181 '-DTFLITE_VERSION_MINOR=' + tflite2_ver_minor,
182 '-DTFLITE_VERSION_MICRO=' + tflite2_ver_micro,
185 message('TensorFlow2-lite version: ' + tflite2_ver)
187 if not cxx.check_header('flatbuffers/flatbuffers.h')
188 error('flatbuffers header files are required to build tensorflow2-lite subplugin. Please install compatible version for tensorflow-lite library. Or disable tflite2-support in meson_options.txt')
191 filter_sub_tflite2_sources = ['tensor_filter_tensorflow_lite.cc']
193 nnstreamer_filter_tflite2_deps = [tflite2_support_deps, thread_dep, libdl_dep, nnstreamer_single_dep]
195 tflite2_compile_args = []
196 tflite2_compile_args += '-DTFLITE_INT8=1'
197 tflite2_compile_args += '-DTFLITE_INT16=1'
198 tflite2_compile_args += '-DTFLITE_FLOAT16=1'
199 tflite2_compile_args += '-DTFLITE_COMPLEX64=1'
201 if cc.has_header('tensorflow2/lite/model.h')
202 tflite2_compile_args += '-DUSE_TENSORFLOW2_HEADER_PATH=1'
205 # Check each delegate linking with given tflite library
208 #include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h"
209 TfLiteXNNPackDelegateOptions xnnpack_options = TfLiteXNNPackDelegateOptionsDefault ();
210 int main() {return 0;}
211 ''', dependencies : [tflite2_support_deps, thread_dep], name : 'xnnpack delegate')
212 tflite2_compile_args += '-DTFLITE_XNNPACK_DELEGATE_SUPPORTED'
217 #include "tensorflow/lite/delegates/gpu/delegate.h"
218 TfLiteGpuDelegateOptionsV2 gpu_options = TfLiteGpuDelegateOptionsV2Default ();
219 int main() {return 0;}
220 ''', dependencies : [tflite2_support_deps, libdl_dep], name : 'gpu delegate')
221 tflite2_compile_args += '-DTFLITE_GPU_DELEGATE_SUPPORTED'
226 #include "tensorflow/lite/delegates/nnapi/nnapi_delegate.h"
227 tflite::StatefulNnApiDelegate::StatefulNnApiDelegate ();
228 int main() {return 0;}
229 ''', dependencies : [tflite2_support_deps], name : 'nnapi delegate')
230 tflite2_compile_args += '-DTFLITE_NNAPI_DELEGATE_SUPPORTED'
235 #include "tensorflow/lite/delegates/external/external_delegate.h"
236 TfLiteExternalDelegateOptions external_options = TfLiteExternalDelegateOptionsDefault ("");
237 int main() {return 0;}
238 ''', dependencies : [tflite2_support_deps, libdl_dep], name : 'external delegate')
239 tflite2_compile_args += '-DTFLITE_EXTERNAL_DELEGATE_SUPPORTED'
242 tflite2_custom_compile_args = tflite2_compile_args
243 tflite2_compile_args += '-DTFLITE_SUBPLUGIN_NAME="tensorflow2-lite"'
245 tflite2_extra_dep = declare_dependency(
246 compile_args : tflite2_compile_args
249 nnstreamer_filter_tflite2_deps += tflite2_extra_dep
250 nnstreamer_filter_tflite2_deps += tflite2_ver_dep
252 shared_library('nnstreamer_filter_tensorflow2-lite',
253 filter_sub_tflite2_sources,
254 dependencies: nnstreamer_filter_tflite2_deps,
256 install_dir: filter_subplugin_install_dir
259 static_library('nnstreamer_filter_tensorflow2-lite',
260 filter_sub_tflite2_sources,
261 dependencies: nnstreamer_filter_tflite2_deps,
263 install_dir: nnstreamer_libdir
267 if (get_option('tflite2-custom-support').enabled() or get_option('tflite2-custom-support').auto()) and not meson.is_cross_build()
268 ## Create libtensorflow2-lite-custom.so support.
270 ## @todo This assumes the same tflite version with the above.
271 ## If the user has downloaded libtensorflow-lite manually, it may incur inconsistency.
272 ## @todo This does not use pkgconfig or find_library/meson-dep info
273 ## because it does not allow querying libpath and static/shared of a dependency object.
274 ## @todo If we are allowed to use meson > 0.53, use "FS" module!
277 join_paths(meson.current_source_dir(), 'libtensorflow2-lite.so'),
278 join_paths(meson.current_build_dir(), 'libtensorflow2-lite.so'),
279 join_paths(nnstreamer_libdir, 'libtensorflow2-lite.so'),
280 '/usr/lib/libtensorflow2-lite.so',
281 '/usr/lib64/libtensorflow2-lite.so',
282 './libtensorflow2-lite.so'
285 foreach file : filepaths
286 if run_command('bash', '-c', '[ -f "' + file + '" ]', check : false).returncode() == 0
287 message('Found: ' + file)
291 output: 'libtensorflow2-lite-custom.so',
299 ## No shared tfl lib found. Get static lib and convert it
300 custom_tflite_lib = join_paths(meson.current_build_dir(), 'libtensorflow2-lite-custom.so')
302 filepaths = [join_paths(nnstreamer_libdir, 'libtensorflow2-lite.a'),
303 '/usr/lib/libtensorflow2-lite.a',
304 '/usr/lib64/libtensorflow2-lite.a',
305 './libtensorflow2-lite.a',
306 join_paths(meson.current_build_dir(), 'libtensorflow2-lite.a'),
307 join_paths(meson.current_source_dir(), 'libtensorflow2-lite.a')
310 foreach file : filepaths
311 if run_command('bash', '-c', '[ -f "'+ file + '" ]', check : false).returncode() == 0
312 somake = run_command('gcc', '-shared', '-o', custom_tflite_lib, '-Wl,--whole-archive', file, '-Wl,--no-whole-archive', check : false)
313 if somake.returncode() == 0
314 message('Successfully created libtensorflow2-lite-custom.so from archive: ' + file)
318 error('Cannot create .so from: ' + file)
325 tflite2_custom_compile_args += '-DTFLITE_SUBPLUGIN_NAME="tensorflow2-lite-custom"'
326 tflite2_custom_extra_dep = declare_dependency( compile_args : tflite2_custom_compile_args )
327 tflc_dep = declare_dependency (
328 link_args: ['-L' + meson.current_build_dir(), '-ltensorflow2-lite-custom']
330 shared_library('nnstreamer_filter_tensorflow2-lite-custom',
331 filter_sub_tflite2_sources,
332 dependencies: [tflc_dep, thread_dep, libdl_dep, nnstreamer_single_dep, tflite2_ver_dep, tflite2_custom_extra_dep],
334 install_dir:filter_subplugin_install_dir
336 else # no custom mode built
337 if get_option('tflite2-custom-support').enabled()
338 error('Cannot create tflite2-custom tensor-filter subplugin. No valid .so/.a of tensorflow2-lite found.')
343 if get_option('tflite2-custom-support').enabled()
344 error('tflite2-custom-support requires tflite2-support')
348 if pytorch_support_is_available
349 if cxx.get_id() != 'gcc'
350 error('Pytorch headers (Array.h and reverse_iterator.h) require GCC for license issues. Use GCC or disable pytorch with -Dpytorch-support=disabled.')
353 filter_sub_torch_sources = ['tensor_filter_pytorch.cc']
354 # pytorch sources contain unused parameters
355 ignore_unused_params = declare_dependency(compile_args: ['-Wno-unused-parameter'])
356 pytorch_support_deps += ignore_unused_params
358 nnstreamer_filter_torch_deps = [pytorch_support_deps, nnstreamer_single_dep]
360 shared_library('nnstreamer_filter_pytorch',
361 filter_sub_torch_sources,
362 dependencies: nnstreamer_filter_torch_deps,
364 install_dir: filter_subplugin_install_dir
367 static_library('nnstreamer_filter_pytorch',
368 filter_sub_torch_sources,
369 dependencies: nnstreamer_filter_torch_deps,
371 install_dir: nnstreamer_libdir
375 if caffe2_support_is_available
376 filter_sub_caffe2_sources = ['tensor_filter_caffe2.cc']
378 nnstreamer_filter_caffe2_deps = [caffe2_support_deps, protobuf_dep, glib_dep, nnstreamer_single_dep]
380 shared_library('nnstreamer_filter_caffe2',
381 filter_sub_caffe2_sources,
382 dependencies: nnstreamer_filter_caffe2_deps,
384 install_dir: filter_subplugin_install_dir
387 static_library('nnstreamer_filter_caffe2',
388 filter_sub_caffe2_sources,
389 dependencies: nnstreamer_filter_caffe2_deps,
391 install_dir: nnstreamer_libdir
395 if deepview_rt_support_is_available
396 nnstreamer_filter_deepview_rt_deps = [deepview_rt_support_deps, glib_dep, nnstreamer_single_dep]
398 filter_sub_deepview_rt_sources = ['tensor_filter_deepview_rt.cc']
400 shared_library('nnstreamer_filter_deepview-rt',
401 filter_sub_deepview_rt_sources,
402 dependencies: nnstreamer_filter_deepview_rt_deps,
404 install_dir: filter_subplugin_install_dir
407 static_library('nnstreamer_filter_deepview-rt',
408 filter_sub_deepview_rt_sources,
409 dependencies: nnstreamer_filter_deepview_rt_deps,
411 install_dir: nnstreamer_libdir
416 filter_sub_python3_sources = ['tensor_filter_python3.cc']
418 shared_library('nnstreamer_filter_python3',
419 filter_sub_python3_sources,
420 dependencies: nnstreamer_python3_helper_dep,
422 install_dir: filter_subplugin_install_dir
425 static_library('nnstreamer_filter_python3',
426 filter_sub_python3_sources,
427 dependencies: nnstreamer_python3_helper_dep,
429 install_dir: nnstreamer_libdir
433 if mvncsdk2_support_is_available
434 filter_sub_mvncsdk2_sources = [
435 'tensor_filter_movidius_ncsdk2.c'
438 nnstreamer_filter_mvncsdk2_deps = [mvncsdk2_support_deps, glib_dep, nnstreamer_single_dep]
440 shared_library('nnstreamer_filter_movidius-ncsdk2',
441 filter_sub_mvncsdk2_sources,
442 dependencies: nnstreamer_filter_mvncsdk2_deps,
444 install_dir: filter_subplugin_install_dir
447 static_library('nnstreamer_filter_movidius-ncsdk2',
448 filter_sub_mvncsdk2_sources,
449 dependencies: nnstreamer_filter_mvncsdk2_deps,
451 install_dir: nnstreamer_libdir
455 if get_option('enable-cppfilter')
456 filter_sub_cpp_sources = ['tensor_filter_cpp.cc']
458 nnstreamer_cpp_lib = shared_library('nnstreamer_filter_cpp',
459 filter_sub_cpp_sources,
460 dependencies: nnstreamer_single_dep,
462 install_dir: filter_subplugin_install_dir
464 install_headers(['tensor_filter_cpp.hh'],
467 configure_file(input: 'nnstreamer-cpp.pc.in', output: 'nnstreamer-cpp.pc',
468 install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
469 configuration: nnstreamer_install_conf
471 nnstreamer_cpp_dep = declare_dependency(link_with: nnstreamer_cpp_lib,
472 dependencies: nnstreamer_single_dep,
473 include_directories: include_directories('.')
477 if get_option('enable-edgetpu')
478 if not get_option('enable-filter-cpp-class')
479 error ('enable-filter-cpp-class should be set as \'true\' to build the tensor filter for Edge TPU.')
482 edgetpu_dep = dependency('edgetpu', required: false)
483 if not edgetpu_dep.found()
484 # Since the developement package for Ubuntu does not have pkgconfig file,
485 # check that the required header and library files exist in the system
486 # include and lib directories.
487 if cxx.has_header('edgetpu.h')
488 edgetpu_dep = declare_dependency (
489 dependencies: cxx.find_library('edgetpu'),
492 error('failed to resolve the build dependency of the tensor filter for Edge TPU.')
496 nnstreamer_filter_edgetpu_deps = [glib_dep, nnstreamer_single_dep, edgetpu_dep, libdl_dep]
498 if tflite2_support_is_available
499 nnstreamer_filter_edgetpu_deps += [tflite2_support_deps, tflite2_ver_dep]
500 message('build Edge TPU sub-plugin with tensorflow2-lite')
501 elif tflite_support_is_available
502 nnstreamer_filter_edgetpu_deps += [tflite_support_deps, tflite_ver_dep]
503 message('build Edge TPU sub-plugin with tensorflow1-lite')
505 error ('tflite2-support or tflite-support should be set as \'enabled\' to build the tensor filter for Edge TPU.')
508 filter_sub_edgetpu_sources = ['tensor_filter_edgetpu.cc']
510 rpath_edgetpu_test_helper = ''
511 if get_option('enable-test')
513 In order to use the test helper library, add build_rpath.
514 This temporarily overrides the runtime dependency on edge tpu and
515 it is removed after installation.
517 rpath_edgetpu_test_helper = join_paths(meson.build_root(), 'tests/nnstreamer_filter_edgetpu')
520 shared_library('nnstreamer_filter_edgetpu',
521 filter_sub_edgetpu_sources,
522 dependencies: nnstreamer_filter_edgetpu_deps,
524 install_dir: filter_subplugin_install_dir,
525 build_rpath: rpath_edgetpu_test_helper
529 if get_option('enable-openvino')
531 openvino_cpp_args = []
532 openvino_deps += dependency('openvino', required: true)
533 if cxx.has_header('ext_list.hpp')
534 openvino_cpuext_lib = cxx.find_library('cpu_extension', required: true)
535 if openvino_cpuext_lib.found()
536 openvino_cpp_args += '-D__OPENVINO_CPU_EXT__=1'
537 openvino_deps += openvino_cpuext_lib
539 error('Cannot find the shared object, libcpu_extension.')
542 filter_sub_openvino_sources = ['tensor_filter_openvino.cc']
544 nnstreamer_filter_openvino_deps = [glib_dep, nnstreamer_single_dep, openvino_deps]
546 nnstreamer_filter_openvino_so_lib = shared_library('nnstreamer_filter_openvino',
547 filter_sub_openvino_sources,
548 cpp_args: openvino_cpp_args,
549 dependencies: nnstreamer_filter_openvino_deps,
551 install_dir: filter_subplugin_install_dir
554 static_library('nnstreamer_filter_openvino',
555 filter_sub_openvino_sources,
556 cpp_args: openvino_cpp_args,
557 dependencies: nnstreamer_filter_openvino_deps,
559 install_dir: nnstreamer_libdir
562 nnstreamer_filter_openvino_dep = declare_dependency(
563 link_with: nnstreamer_filter_openvino_so_lib,
564 include_directories: include_directories('.')
568 if get_option('enable-vivante')
572 if get_option('enable-mediapipe')
573 if host_machine.system() == 'linux' and host_machine.cpu_family() == 'x86_64'
574 opencv_path = 'bazel-bin/_solib_k8/_U@linux_Uopencv_S_S_Copencv___Uexternal_Slinux_Uopencv_Slib_Sx86_U64-linux-gnu'
576 error('Not Supported System & Architecture. Linux x86_64 is required')
579 cmd = run_command('sh', '-c', 'echo $MEDIAPIPE_HOME', check : true)
580 MEDIAPIPE_HOME = cmd.stdout().strip()
581 if MEDIAPIPE_HOME == ''
582 error('MEDIAPIPE_HOME is not set')
584 message('MEDIAPIPE_HOME: ' + MEDIAPIPE_HOME)
585 # TODO: This is not a portable way to check if a directory exists
586 # After bumping up to 0.53.0, the following line can be replaced with one that uses FS module
587 mediapipe_dir_exist = run_command('[', '-d', MEDIAPIPE_HOME, ']', check : false).returncode()
588 if mediapipe_dir_exist != 0
589 error('Cannot find MEDIAPIPE_HOME: ' + MEDIAPIPE_HOME)
592 mediapipe_incdir = include_directories(
594 join_paths(MEDIAPIPE_HOME, 'bazel-bin'),
595 join_paths(MEDIAPIPE_HOME, 'bazel-mediapipe/external/eigen_archive'),
596 join_paths(MEDIAPIPE_HOME, 'bazel-mediapipe/external/com_google_absl'),
599 run_command('sh', '-c', meson.source_root() + '/tools/development/gen_mediapipe_libs.sh ' + nnstreamer_libdir, check : true)
601 mediapipe_internal_dep = cxx.find_library('mediapipe_internal', dirs: nnstreamer_libdir)
602 mediapipe_external_dep = cxx.find_library('mediapipe_external', dirs: nnstreamer_libdir)
604 opencv_core_dep = cc.find_library('opencv_core', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
605 opencv_video_dep = cc.find_library('opencv_video', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
606 opencv_imgcodecs_dep = cc.find_library('opencv_imgcodecs', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
607 opencv_imgproc_dep = cc.find_library('opencv_imgproc', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
608 opencv_calib3d_dep = cc.find_library('opencv_calib3d', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
609 opencv_highgui_dep = cc.find_library('opencv_highgui', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
610 opencv_videoio_dep = cc.find_library('opencv_videoio', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
611 opencv_features2d_dep = cc.find_library('opencv_features2d', dirs: join_paths(MEDIAPIPE_HOME, opencv_path))
613 nnstreamer_filter_mediapipe_deps = [
615 nnstreamer_single_dep,
618 opencv_imgcodecs_dep,
623 opencv_features2d_dep,
624 mediapipe_external_dep,
625 mediapipe_internal_dep
628 filter_sub_mp_sources = ['tensor_filter_mediapipe.cc']
630 shared_library('nnstreamer_filter_mediapipe',
631 filter_sub_mp_sources,
632 dependencies: nnstreamer_filter_mediapipe_deps,
633 include_directories: mediapipe_incdir,
635 install_dir: filter_subplugin_install_dir
639 if snpe_support_is_available
640 filter_sub_snpe_sources = ['tensor_filter_snpe.cc']
641 nnstreamer_filter_snpe_deps = [glib_dep, nnstreamer_single_dep, snpe_support_deps, declare_dependency(compile_args: ['-Wno-deprecated-declarations'])]
643 shared_library('nnstreamer_filter_snpe',
644 filter_sub_snpe_sources,
645 dependencies: nnstreamer_filter_snpe_deps,
647 install_dir: filter_subplugin_install_dir
650 static_library('nnstreamer_filter_snpe',
651 filter_sub_snpe_sources,
652 dependencies: nnstreamer_filter_snpe_deps,
654 install_dir: nnstreamer_libdir
658 if tensorrt_support_is_available
659 filter_sub_tensorrt_sources = ['tensor_filter_tensorrt.cc']
661 nnstreamer_filter_tensorrt_deps = [glib_dep, nnstreamer_single_dep, tensorrt_support_deps]
663 shared_library('nnstreamer_filter_tensorrt',
664 filter_sub_tensorrt_sources,
665 dependencies: nnstreamer_filter_tensorrt_deps,
667 install_dir: filter_subplugin_install_dir
670 static_library('nnstreamer_filter_tensorrt',
671 filter_sub_tensorrt_sources,
672 dependencies: nnstreamer_filter_tensorrt_deps,
674 install_dir: nnstreamer_libdir
678 if lua_support_is_available
679 if lua_support_deps[0].version().version_compare('>=5.3')
680 message ('tensor-filter::lua does not support Lua >= 5.3, yet. Fix #3531 first.')
681 lua_support_is_available = disabler()
685 if lua_support_is_available
686 filter_sub_lua_sources = ['tensor_filter_lua.cc']
688 nnstreamer_filter_lua_deps = [glib_dep, nnstreamer_single_dep, lua_support_deps]
690 shared_library('nnstreamer_filter_lua',
691 filter_sub_lua_sources,
692 dependencies: nnstreamer_filter_lua_deps,
694 install_dir: filter_subplugin_install_dir
697 static_library('nnstreamer_filter_lua',
698 filter_sub_lua_sources,
699 dependencies: nnstreamer_filter_lua_deps,
701 install_dir: nnstreamer_libdir
705 if tvm_support_is_available
706 nnstreamer_filter_tvm_deps = [tvm_support_deps, glib_dep, nnstreamer_dep]
708 filter_sub_tvm_sources = ['tensor_filter_tvm.cc']
710 shared_library('nnstreamer_filter_tvm',
711 filter_sub_tvm_sources,
712 dependencies: nnstreamer_filter_tvm_deps,
714 install_dir: filter_subplugin_install_dir
717 static_library('nnstreamer_filter_tvm',
718 filter_sub_tvm_sources,
719 dependencies: nnstreamer_filter_tvm_deps,
721 install_dir: nnstreamer_libdir
725 if trix_engine_support_is_available
726 nnstreamer_filter_trix_engine_deps = [trix_engine_support_deps, glib_dep, nnstreamer_single_dep]
728 filter_sub_trix_engine_sources = ['tensor_filter_trix_engine.cc']
730 shared_library('nnstreamer_filter_trix-engine',
731 filter_sub_trix_engine_sources,
732 dependencies: nnstreamer_filter_trix_engine_deps,
734 install_dir: filter_subplugin_install_dir
737 static_library('nnstreamer_filter_trix-engine',
738 filter_sub_trix_engine_sources,
739 dependencies: nnstreamer_filter_trix_engine_deps,
741 install_dir: nnstreamer_libdir
745 if mxnet_support_is_available
746 if not get_option('enable-filter-cpp-class')
747 error ('enable-filter-cpp-class should be set as \'true\' to build the tensor filter for MXNet.')
750 filter_sub_mxnet_sources = [
751 'tensor_filter_mxnet.cc'
754 nnstreamer_filter_mxnet_deps = [mxnet_support_deps, glib_dep, nnstreamer_single_dep, libdl_dep]
756 nnstreamer_filter_mxnet_so_lib = shared_library('nnstreamer_filter_mxnet',
757 filter_sub_mxnet_sources,
758 dependencies: nnstreamer_filter_mxnet_deps,
760 install_dir: filter_subplugin_install_dir,
761 cpp_args: ['-Wno-non-virtual-dtor']
764 nnstreamer_filter_mxnet_dep = declare_dependency(
765 link_with: nnstreamer_filter_mxnet_so_lib,
766 include_directories: include_directories('.')
770 if ncnn_support_is_available
771 filter_sub_ncnn_sources = ['tensor_filter_ncnn.cc']
773 nnstreamer_filter_ncnn_deps = [ncnn_support_deps, glib_dep, nnstreamer_single_dep]
775 shared_library('nnstreamer_filter_ncnn',
776 filter_sub_ncnn_sources,
777 dependencies: nnstreamer_filter_ncnn_deps,
779 install_dir: filter_subplugin_install_dir
782 static_library('nnstreamer_filter_ncnn',
783 filter_sub_ncnn_sources,
784 dependencies: nnstreamer_filter_ncnn_deps,
786 install_dir: nnstreamer_libdir
790 if onnxruntime_support_is_available
791 filter_sub_onnxruntime_sources = ['tensor_filter_onnxruntime.cc']
793 nnstreamer_filter_onnxruntime_deps = [glib_dep, nnstreamer_single_dep, onnxruntime_support_deps]
795 shared_library('nnstreamer_filter_onnxruntime',
796 filter_sub_onnxruntime_sources,
797 dependencies: nnstreamer_filter_onnxruntime_deps,
799 install_dir: filter_subplugin_install_dir
802 static_library('nnstreamer_filter_onnxruntime',
803 filter_sub_onnxruntime_sources,
804 dependencies: nnstreamer_filter_onnxruntime_deps,
806 install_dir: nnstreamer_libdir