Skip to content

Commit

Permalink
[Meson] unnecessary cond
Browse files Browse the repository at this point in the history
Code clean, remove unnecessary cond when checking package dependency.

Signed-off-by: Jaeyun Jung <[email protected]>
  • Loading branch information
jaeyun-jung committed Aug 9, 2024
1 parent ceb64b8 commit 39c5494
Showing 1 changed file with 13 additions and 39 deletions.
52 changes: 13 additions & 39 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ libm_dep = cc.find_library('m') # cmath library
libdl_dep = cc.find_library('dl') # DL library
thread_dep = dependency('threads') # pthread for tensorflow-lite

opencv_dep = dependency('opencv4', required: false)
protobuf_dep = dependency('protobuf', version: '>= 3.4.0', required: false)

# Dependency for custom filter examples
nns_dep = dependency('nnstreamer', required: false)

Expand All @@ -44,74 +47,45 @@ nns_capi_common_dep = dependency('capi-ml-common', required: false)

# Dependency for tensorflow example
tf_dep = dependency('tensorflow', required: false)
protobuf_dep = dependency('protobuf', version: '>= 3.4.0', required: false)

have_tensorflow = false
if tf_dep.found() and protobuf_dep.found()
have_tensorflow = true
endif
have_tensorflow = tf_dep.found() and protobuf_dep.found()

# Dependency for tensorflow-lite example
tflite_dep = dependency('tensorflow-lite', required: false)
tflite2_dep = dependency('tensorflow2-lite', required: false)

have_tensorflow_lite = false
if tflite_dep.found() or tflite2_dep.found()
have_tensorflow_lite = true
endif
have_tensorflow_lite = tflite_dep.found() or tflite2_dep.found()

# Dependency for caffe2 example
caffe2_dep = dependency('caffe2', required: false)

have_caffe2 = false
if caffe2_dep.found() and protobuf_dep.found()
have_caffe2 = true
endif
have_caffe2 = caffe2_dep.found() and protobuf_dep.found()

# Dependency for nnfw example
nnfw_dep = dependency('nnfw', required: false)
if not nnfw_dep.found()
nnfw_dep = cc.find_library('nnfw-dev', required: false)
endif

have_nnfw = false
if nnfw_dep.found()
have_nnfw = true
endif
have_nnfw = nnfw_dep.found()

# Dependency for openvino example
openvino_dep = dependency('openvino', required: false)

have_openvino = false
if openvino_dep.found()
have_openvino = true
endif
have_openvino = openvino_dep.found()

# Dependency for pytorch example
pytorch_dep = dependency('pytorch', required: false)
have_pytorch = false
if pytorch_dep.found()
have_pytorch = true
if not pytorch_dep.found()
pytorch_dep = dependency('torch', required: false)
endif
have_pytorch = pytorch_dep.found()

# Dependency for nnstreamer-edge examples
nns_edge_dep = dependency('nnstreamer-edge', required: false)

# Dependency for ncnn examples
ncnn_dep = dependency('ncnn', required: false)
have_ncnn = false
if ncnn_dep.found()
have_ncnn = true
endif
have_ncnn = ncnn_dep.found()

# Dependency for onnxruntime examples
onnx_dep = dependency('libonnxruntime', required: false)
have_onnx = false
if onnx_dep.found()
have_onnx = true
endif

opencv_dep = dependency('opencv4', required: false)
have_onnx = onnx_dep.found()

# Dependency for training offloading example
nntrainer_dep = dependency('nntrainer', required: false)
Expand Down

0 comments on commit 39c5494

Please sign in to comment.