# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License

import("//build/config/features.gni")
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../hdf_core/adapter/uhdf2/uhdf.gni")
import("../../camera.gni")

include_dirs = [ "$camera_path/include" ]

deps = [
  "//drivers/interface/camera/v1_2:libcamera_proxy_1.2",
  "//drivers/interface/camera/v1_2:libcamera_stub_1.2",
]

if (fuzztest_enable_bule_environment) {
  include_dirs += [
    "$camera_path/../../interfaces/include",
    "$camera_path/../../interfaces/hdi_ipc",
    "$camera_path/../../interfaces/hdi_ipc/utils/include",
    "$camera_path/../../interfaces/hdi_ipc/callback/host/include",
    "$camera_path/../../interfaces/hdi_ipc/callback/device/include",
    "$camera_path/../../interfaces/hdi_ipc/callback/operator/include",
    "$camera_path/../v4l2",
    "$camera_path/../v4l2/include",
    "$camera_path/../v4l2/include/camera_host",
    "$camera_path/../v4l2/include/camera_device",
    "$camera_path/../v4l2/include/stream_operator",
    "$camera_path/../v4l2/include/offline_stream_operator",
    "$camera_path/device_manager/include/",
    "$camera_path/device_manager/include/mpi",
    "$camera_path/pipeline_core/utils",
    "$camera_path/pipeline_core/pipeline_impl/include",
    "$camera_path/pipeline_core/host_stream/include",
    "$camera_path/pipeline_core/include",
    "$camera_path/pipeline_core/ipp/include",
    "$camera_path/pipeline_core/nodes/include",
    "$camera_path/utils/event",
    "$camera_path/../v4l2/src/stream_operator/stream_tunnel/standard",
  ]
  deps += [
    "$board_camera_path/device_manager:camera_device_manager",
    "$board_camera_path/pipeline_core:camera_pipeline_core",
    "$camera_path/../../hdi_service/v1_0:camera_host_service_1.0",
    "$camera_path/buffer_manager:camera_buffer_manager",
  ]
}

cflags = [
  "-g",
  "-O0",
  "-fno-omit-frame-pointer",
]

external_deps = [
  "drivers_interface_camera:metadata",
  "hdf_core:libhdf_ipc_adapter",
  "hdf_core:libhdf_utils",
  "hdf_core:libhdi",
  "hilog:libhilog",
  "ipc:ipc_core",
]

group("camera_hdi_fuzztest") {
  testonly = true
  deps = []

  deps += [
    "camera_device:fuzztest",
    "camera_host:fuzztest",
    "defferred_delivery_image:fuzztest",
    "stream_operator:fuzztest",
  ]
}