[C-API] Use mock header instead of Tizen dependent one
authorWook Song <wook16.song@samsung.com>
Thu, 24 Oct 2019 09:02:49 +0000 (18:02 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 24 Oct 2019 15:41:12 +0000 (00:41 +0900)
In order to build C-API for Non-Tizen platforms, nnstreamer.h should be
modified at build time to emulate some Tizen-dependent symbols.
Instead, this patch adds a mock header, tizen_error.h, which emulates
those symbols and includes needed system header. Therefore, it is
possible to build C-API by adding this header to the build tree when
enabling C-API for Non-Tizen platform.

Signed-off-by: Wook Song <wook16.song@samsung.com>
api/capi/meson.build
debian/rules
meson.build

index aadb87c..0be5746 100644 (file)
@@ -18,9 +18,13 @@ if meson.project_name() != 'nnstreamer'
 endif
 
 
+capi_inc = []
+if not get_option('enable-tizen')
+  capi_inc += include_directories ('include/platform')
+endif
 inc = include_directories('include')
 nninc = include_directories('../../gst')
-capi_inc = [inc, nninc]
+capi_inc += [inc, nninc]
 
 capi_main = []
 capi_main += join_paths(meson.current_source_dir(), 'src', 'nnstreamer-capi-pipeline.c')
@@ -37,6 +41,8 @@ capi_devel_main += join_paths(meson.current_source_dir(), 'include', 'nnstreamer
 if get_option('enable-tizen')
   # header for Tizen internal API
   capi_devel_main += join_paths(meson.current_source_dir(), 'include', 'nnstreamer-tizen-internal.h')
+else
+  capi_devel_main += join_paths(meson.current_source_dir(), 'include', 'platform', 'tizen_error.h')
 endif
 
 # Dependencies
index a296c6d..4c447ef 100755 (executable)
@@ -58,5 +58,4 @@ override_dh_auto_install:
 
 override_dh_install:
        dh_install --sourcedir=debian/tmp --list-missing
-       patch -R -p1 -i ./packaging/non_tizen_build.patch
 # Add --fail-missing option after adding *.install files for all subpackages.
index cac1961..f99e300 100644 (file)
@@ -227,19 +227,6 @@ if get_option('enable-nnfw')
   # This also enables nnfw as a subplugin for Tizen.
 endif
 
-# Patch for non-tizen build
-patch_file = join_paths(meson.current_source_dir(), 'packaging', 'non_tizen_build.patch')
-if (not get_option('enable-tizen')) and get_option('enable-capi')
-  r = run_command('patch', '-R', '--dry-run', '-sfp1', '-i', patch_file)
-  if (r.returncode() != 0)
-    r = run_command('patch', '-p1', '-i', patch_file)
-    if (r.returncode() != 0)
-      message('Non-Tizen mode support failed')
-    endif
-  endif
-  message('CAPI is in non-Tizen mode')
-endif
-
 # Build nnstreamer (common, plugins)
 subdir('gst')