From 33078420d4be5f535b01a29f827fa7bb9b669e68 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Tue, 5 Mar 2019 16:12:09 +0900 Subject: [PATCH] [Meson] fix file paths add current dir path and clean up meson script. This will make to get the unittest coverage for ext sub-plugins. Signed-off-by: Jaeyun Jung --- ext/meson.build | 1 + ext/nnstreamer/meson.build | 2 ++ ext/nnstreamer/tensor_decoder/meson.build | 60 +++++++++++++++++++++---------- ext/nnstreamer/tensor_filter/meson.build | 14 ++++++-- gst/nnstreamer/tensor_decoder/meson.build | 2 +- meson.build | 5 ++- 6 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 ext/meson.build create mode 100644 ext/nnstreamer/meson.build diff --git a/ext/meson.build b/ext/meson.build new file mode 100644 index 0000000..27b09ec --- /dev/null +++ b/ext/meson.build @@ -0,0 +1 @@ +subdir('nnstreamer') diff --git a/ext/nnstreamer/meson.build b/ext/nnstreamer/meson.build new file mode 100644 index 0000000..81b90a2 --- /dev/null +++ b/ext/nnstreamer/meson.build @@ -0,0 +1,2 @@ +subdir('tensor_decoder') +subdir('tensor_filter') diff --git a/ext/nnstreamer/tensor_decoder/meson.build b/ext/nnstreamer/tensor_decoder/meson.build index e4e8be3..8071522 100644 --- a/ext/nnstreamer/tensor_decoder/meson.build +++ b/ext/nnstreamer/tensor_decoder/meson.build @@ -1,44 +1,68 @@ -tensor_decoder_directvideo_shared = shared_library('nnstreamer_decoder_direct_video', - [ 'tensordec-directvideo.c' ], +# direct video +decoder_sub_direct_video_sources = [ + 'tensordec-directvideo.c' +] + +nnstreamer_decoder_direct_video_sources = [] +foreach s : decoder_sub_direct_video_sources + nnstreamer_decoder_direct_video_sources += join_paths(meson.current_source_dir(), s) +endforeach + +shared_library('nnstreamer_decoder_direct_video', + nnstreamer_decoder_direct_video_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: decoder_subplugin_install_dir ) -tensor_decoder_directvideo_static = static_library('nnstreamer_decoder_direct_video', - [ 'tensordec-directvideo.c' ], +static_library('nnstreamer_decoder_direct_video', + nnstreamer_decoder_direct_video_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: nnstreamer_libdir ) -tensor_decoder_imagelabel_shared = shared_library('nnstreamer_decoder_image_labeling', - [ 'tensordec-imagelabel.c' ], +# image labeling +decoder_sub_image_labeling_sources = [ + 'tensordec-imagelabel.c' +] + +nnstreamer_decoder_image_labeling_sources = [] +foreach s : decoder_sub_image_labeling_sources + nnstreamer_decoder_image_labeling_sources += join_paths(meson.current_source_dir(), s) +endforeach + +shared_library('nnstreamer_decoder_image_labeling', + nnstreamer_decoder_image_labeling_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: decoder_subplugin_install_dir ) -tensor_decoder_imagelabel_static = static_library('nnstreamer_decoder_image_labeling', - [ 'tensordec-imagelabel.c' ], +static_library('nnstreamer_decoder_image_labeling', + nnstreamer_decoder_image_labeling_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: nnstreamer_libdir ) -tensor_decoder_boundingbox_shared = shared_library('nnstreamer_decoder_bounding_boxes', - [ 'tensordec-boundingbox.c' ], +# bounding boxes +decoder_sub_bounding_boxes_sources = [ + 'tensordec-boundingbox.c' +] + +nnstreamer_decoder_bounding_boxes_sources = [] +foreach s : decoder_sub_bounding_boxes_sources + nnstreamer_decoder_bounding_boxes_sources += join_paths(meson.current_source_dir(), s) +endforeach + +shared_library('nnstreamer_decoder_bounding_boxes', + nnstreamer_decoder_bounding_boxes_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: decoder_subplugin_install_dir ) -tensor_decoder_boundingbox_static = static_library('nnstreamer_decoder_bounding_boxes', - [ 'tensordec-boundingbox.c' ], +static_library('nnstreamer_decoder_bounding_boxes', + nnstreamer_decoder_bounding_boxes_sources, dependencies: [nnstreamer_dep, glib_dep, gst_dep], - include_directories: nnstreamer_inc, install: true, install_dir: nnstreamer_libdir ) diff --git a/ext/nnstreamer/tensor_filter/meson.build b/ext/nnstreamer/tensor_filter/meson.build index adfb810..f032e60 100644 --- a/ext/nnstreamer/tensor_filter/meson.build +++ b/ext/nnstreamer/tensor_filter/meson.build @@ -1,9 +1,14 @@ if have_tensorflow - nnstreamer_filter_tf_sources = [ + filter_sub_tf_sources = [ 'tensor_filter_tensorflow.c', 'tensor_filter_tensorflow_core.cc' ] + nnstreamer_filter_tf_sources = [] + foreach s : filter_sub_tf_sources + nnstreamer_filter_tf_sources += join_paths(meson.current_source_dir(), s) + endforeach + nnstreamer_filter_tf_deps = [tf_dep, protobuf_dep, glib_dep, gst_dep, nnstreamer_dep] shared_library('nnstreamer_filter_tensorflow', @@ -24,11 +29,16 @@ if have_tensorflow endif if have_tensorflow_lite - nnstreamer_filter_tflite_sources = [ + filter_sub_tflite_sources = [ 'tensor_filter_tensorflow_lite.c', 'tensor_filter_tensorflow_lite_core.cc' ] + nnstreamer_filter_tflite_sources = [] + foreach s : filter_sub_tflite_sources + nnstreamer_filter_tflite_sources += join_paths(meson.current_source_dir(), s) + endforeach + nnstreamer_filter_tflite_deps = [tflite_dep, thread_dep, libdl_dep, glib_dep, gst_dep, nnstreamer_dep] shared_library('nnstreamer_filter_tensorflow-lite', diff --git a/gst/nnstreamer/tensor_decoder/meson.build b/gst/nnstreamer/tensor_decoder/meson.build index 8f4c22c..fee6bcf 100644 --- a/gst/nnstreamer/tensor_decoder/meson.build +++ b/gst/nnstreamer/tensor_decoder/meson.build @@ -1,5 +1,5 @@ tensor_decoder_sources = [ - 'tensordec.c', + 'tensordec.c' ] foreach s : tensor_decoder_sources diff --git a/meson.build b/meson.build index 33eb705..ea56115 100644 --- a/meson.build +++ b/meson.build @@ -107,9 +107,8 @@ endif # Build nnstreamer (common, plugins) subdir('gst') -# Build ext subplugins (filter-subplugins) -subdir('ext/nnstreamer/tensor_filter') -subdir('ext/nnstreamer/tensor_decoder') +# Build ext subplugins +subdir('ext') # Build nnstreamer examples if get_option('enable-test') or get_option('install-example') -- 2.7.4