]
# gsttensorsrc
-tensor_src_sources = []
-gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
-if gst18_dep.found()
- tensor_src_sources += 'gsttensor_srciio.c'
-else
- message('tensor_src_iio requires GStreamer >= 1.8. Skipping it')
+if tensor_src_iio_build
+ nnstreamer_sources += join_paths(meson.current_source_dir(), 'gsttensor_srciio.c')
endif
-foreach s : tensor_src_sources
- if build_platform != 'macos'
- nnstreamer_sources += join_paths(meson.current_source_dir(), s)
- endif
-endforeach
-
# gsttensortransform
if orcc_support_is_available
# tensor_transform does not need to generate -dist files.
#include <elements/gsttensor_split.h>
#include <elements/gsttensor_transform.h>
-#if defined(__gnu_linux__) && !defined(__ANDROID__)
+#ifdef _ENABLE_SRC_IIO
#include <elements/gsttensor_srciio.h>
-#endif /* __gnu_linux__ && !__ANDROID__ */
+#endif
#include <tensor_filter/tensor_filter.h>
#if defined(ENABLE_NNSTREAMER_EDGE)
NNSTREAMER_INIT (plugin, query_serversink, QUERY_SERVERSINK);
NNSTREAMER_INIT (plugin, query_client, QUERY_CLIENT);
#endif
-#if defined(__gnu_linux__) && !defined(__ANDROID__)
- /* IIO requires Linux / non-Android */
-#if (GST_VERSION_MAJOR == 1) && (GST_VERSION_MINOR >= 8)
- /* SRC-IIO code uses GST 1.8+ APIs. */
+#ifdef _ENABLE_SRC_IIO
NNSTREAMER_INIT (plugin, src_iio, SRC_IIO);
#endif
-#endif /* __gnu_linux__ && !__ANDROID__ */
return TRUE;
}
endif
+# See if src-iio can be built or not
+gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
+tensor_src_iio_build = false
+if gst18_dep.found() and build_platform != 'macos'
+ add_project_arguments('-D_ENABLE_SRC_IIO', language: ['c', 'cpp'])
+ message('tensor_src_iio enabled')
+ tensor_src_iio_build = true
+else
+ message('tensor_src_iio disabled: it requires GStreamer >= 1.8 and Linux')
+endif
+
# Build nnstreamer (common, plugins)
subdir('gst')
endif
# Run unittest_src_iio
- if build_platform != 'macos'
+ if tensor_src_iio_build
unittest_src_iio = executable('unittest_src_iio',
join_paths('nnstreamer_source', 'unittest_src_iio.cc'),
dependencies: [nnstreamer_unittest_deps],