[Tizen 4.0/C-API] Detach mm-resource-manager
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 27 Mar 2020 07:26:23 +0000 (16:26 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 7 Apr 2020 07:32:09 +0000 (16:32 +0900)
mm-resource-manager is not available at Tizen 4.0.
Do not depend on Tizen API mm-resource-manager if it is Tizen 4.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
api/capi/include/nnstreamer-capi-private.h
api/capi/meson.build
meson.build
meson_options.txt
packaging/nnstreamer.spec

index 9d3f92a..3776734 100644 (file)
 
 #define set_feature_state(...) ml_tizen_set_feature_state(__VA_ARGS__)
 #define convert_tizen_element(...) ml_tizen_convert_element(__VA_ARGS__)
+
+#if (TIZENVERSION >= 5) && (TIZENVERSION < 9999)
 #define get_tizen_resource(...) ml_tizen_get_resource(__VA_ARGS__)
 #define release_tizen_resource(...) ml_tizen_release_resource(__VA_ARGS__)
+#elif (TIZENVERSION < 5)
+#define get_tizen_resource(...) (0)
+#define release_tizen_resource(...) do { } while (0)
+#else
+#error Tizen version is not defined.
+#endif
+
 #else
 #define check_feature_state()
 #define set_feature_state(...)
index 7c63bac..62ca796 100644 (file)
@@ -54,15 +54,26 @@ capi_deps = [
 if (get_option('enable-tizen'))
   message('CAPI is in Tizen mode')
 
-  tizen_deps = [
-    dependency('dpm'),
-    dependency('mm-resource-manager'),
-    dependency('mm-camcorder'),
-    dependency('capi-privacy-privilege-manager'),
-    dependency('capi-base-common'),
-    dependency('capi-system-info'),
-    dependency('dlog')
-  ]
+  if (tizenVmajor == 4)
+    tizen_deps = [
+      dependency('dpm'),
+      dependency('mm-camcorder'),
+      dependency('capi-privacy-privilege-manager'),
+      dependency('capi-base-common'),
+      dependency('capi-system-info'),
+      dependency('dlog')
+    ]
+  else
+    tizen_deps = [
+      dependency('dpm'),
+      dependency('mm-resource-manager'),
+      dependency('mm-camcorder'),
+      dependency('capi-privacy-privilege-manager'),
+      dependency('capi-base-common'),
+      dependency('capi-system-info'),
+      dependency('dlog')
+    ]
+  endif
 
   capi_deps += tizen_deps
 endif
index 21e06bb..dad182a 100644 (file)
@@ -23,6 +23,10 @@ if get_option('enable-tizen')
   # Pass __TIZEN__ to the compiler
   add_project_arguments('-D__TIZEN__=1', language: ['c', 'cpp'])
   build_platform = 'tizen'
+
+  tizenVmajor = get_option('tizen-version-major')
+  add_project_arguments('-DTIZENVERSION='+tizenVmajor.to_string(), language: ['c', 'cpp'])
+
 elif not meson.is_cross_build()
   if cc.get_id() == 'clang' and cxx.get_id() == 'clang'
     if build_machine.system() == 'darwin'
index 13a732b..4f68340 100644 (file)
@@ -15,6 +15,7 @@ option('enable-symbolic-link', type: 'boolean', value: true)
 option('enable-capi', type: 'boolean', value: false)
 option('enable-python', type: 'boolean', value: false)
 option('enable-tizen', type: 'boolean', value: false)
+option('tizen-version-major', type: 'integer', min : 4, max : 9999, value: 9999) # 9999 means "not Tizen"
 option('enable-element-restriction', type: 'boolean', value: false) # true to restrict gst-elements in api
 option('restricted-elements', type: 'string', value: '')
 option('enable-tflite-nnapi-delegation', type: 'boolean', value: false) # true to enable tensorflow-lite to delegate nnapi interpretation to nnfw backend in tizen
index d13df1b..8e73e4b 100644 (file)
@@ -65,7 +65,9 @@ BuildRequires:        meson >= 0.50.0
 
 # To run test cases, we need gst plugins
 BuildRequires: gst-plugins-good
+%if 0%{tizen_version_major} >= 5
 BuildRequires: gst-plugins-good-extra
+%endif
 BuildRequires: gst-plugins-base
 # and gtest
 BuildRequires: gtest-devel
@@ -115,7 +117,9 @@ BuildRequires:      pkgconfig(libmvnc)
 %endif
 %if %{with tizen}
 BuildRequires: pkgconfig(dpm)
+%if 0%{tizen_version_major} >= 5
 BuildRequires: pkgconfig(mm-resource-manager)
+%endif
 BuildRequires: pkgconfig(mm-camcorder)
 BuildRequires: pkgconfig(capi-privacy-privilege-manager)
 BuildRequires: pkgconfig(capi-system-info)
@@ -306,7 +310,7 @@ You may enable this package to use Google Edge TPU with NNStreamer and Tizen ML
 %endif
 
 %if %{with tizen}
-%define enable_tizen -Denable-tizen=true -Denable-tizen-sensor=true
+%define enable_tizen -Denable-tizen=true -Denable-tizen-sensor=true -Dtizen-version-major=0%{tizen_version_major}
 %define enable_api -Denable-capi=true
 %ifarch %arm aarch64
 %define enable_nnfw_runtime -Denable-nnfw-runtime=true