Filter/Meson: Move 'filter-snpe-list' to the build directory
authorWook Song <wook16.song@samsung.com>
Tue, 27 Dec 2022 04:35:50 +0000 (13:35 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 12 Jan 2023 10:24:34 +0000 (19:24 +0900)
This patch moves the 'filter-snpe-list' file generated during the build
time from the source directory to the build directory.

Signed-off-by: Wook Song <wook16.song@samsung.com>
ext/nnstreamer/tensor_filter/meson.build
packaging/nnstreamer.spec

index 624770d..dd54094 100644 (file)
@@ -641,8 +641,8 @@ if get_option('enable-mediapipe')
   )
 endif
 
-run_command('sh', '-c', 'touch filter_snpe_list', check : true)
 if snpe_support_is_available
+  run_command('sh', '-c', 'touch $MESON_BUILD_ROOT/$MESON_SUBDIR/filter_snpe_list', check : true)
   filter_sub_snpe_sources = ['tensor_filter_snpe.cc']
 
   snpe_cpp_args = []
@@ -665,7 +665,7 @@ if snpe_support_is_available
     install: true,
     install_dir: nnstreamer_libdir
   )
-  run_command('sh', '-c', 'echo "%{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_snpe.so" >> filter_snpe_list', check : true)
+  run_command('sh', '-c', 'echo "%{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_snpe.so" >> $MESON_BUILD_ROOT/$MESON_SUBDIR/filter_snpe_list', check : true)
 endif
 
 if tensorrt_support_is_available
index 9cafadb..9cfe723 100644 (file)
@@ -863,6 +863,8 @@ export NNSTREAMER_DECODERS=${NNSTREAMER_BUILD_ROOT_PATH}/ext/nnstreamer/tensor_d
 export NNSTREAMER_CONVERTERS=${NNSTREAMER_BUILD_ROOT_PATH}/ext/nnstreamer/tensor_converter
 export NNSTREAMER_TRAINERS=${NNSTREAMER_BUILD_ROOT_PATH}/ext/nnstreamer/tensor_trainer
 
+%define files_opetion_for_snpe_subpackage %( if [ -f %{builddir}/ext/nnstreamer/tensor_filter/filter_snpe_list ] ; then \
+       echo "-f %{builddir}/ext/nnstreamer/tensor_filter/filter_snpe_list" ; else echo ""; fi )
 %define test_script $(pwd)/packaging/run_unittests_binaries.sh
 
 # if it's tizen && non-TV, run unittest even if "unit_test"==0 for build-time sanity checks.
@@ -1095,7 +1097,7 @@ cp -r result %{buildroot}%{_datadir}/nnstreamer/unittest/
 %if 0%{?snpe_support}
 # Workaround: Conditionally enable nnstreamer-snpe rpm package
 # when existing actual snpe library (snpe.pc)
-%files snpe -f ext/nnstreamer/tensor_filter/filter_snpe_list
+%files snpe %{files_opetion_for_snpe_subpackage}
 %manifest nnstreamer.manifest
 %defattr(-,root,root,-)
 %endif