[Core/NPU/Meson] Add fallback dependency on npu-engine-emul
authorWook Song <wook16.song@samsung.com>
Tue, 21 Apr 2020 06:21:12 +0000 (15:21 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Tue, 21 Apr 2020 09:14:57 +0000 (18:14 +0900)
This patch makes meson find the npu-engine-emul without user-defined
PKG_CONFIG_PATH.

Signed-off-by: Wook Song <wook16.song@samsung.com>
src/core/npu/meson.build

index 6812bb5..f04a199 100644 (file)
@@ -7,7 +7,17 @@ ne_core_npu_src = [
 ]
 
 if get_option('enable_npu_emul')
-  ne_emul_dep = dependency('npu-engine-emul')
+  ne_emul_dep = dependency(
+      'npu-engine-emul',
+      required: false
+  )
+  if not ne_emul_dep.found()
+    warning('falling back to the hardcoded dependency on "npu-engine-emul"')
+    ne_emul_dep = declare_dependency (
+      compile_args : ['-I/opt/trinity/include/npu-engine'],
+      link_args: ['-L/opt/trinity/lib', '-lnpu-engine-emul'],
+    )
+  endif
   ne_core_npu_dep = declare_dependency(
     sources : [ne_core_npu_src, 'NPUdrvAPI_emul.cc'],
     dependencies : [ne_core_utils_dep, ne_emul_dep],