# Copyright (c) 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("../../camera.gni") if (defined(ohos_lite)) { import("//build/ohos.gni") import("../../../../hdf_core/adapter/uhdf/uhdf.gni") config("camhdi_impl_config") { visibility = [ ":*" ] cflags = [ "-DGST_DISABLE_DEPRECATED", "-DHAVE_CONFIG_H", ] cflags_cc = [ "-std=c++17" ] ldflags = [ "-Wl" ] ldflags += [ "--coverage" ] } ohos_shared_library("camera_host_service_1.0") { output_extension = "z.so" sources = [ "./src/camera_device_service.cpp", "./src/camera_host_service.cpp", "./src/offline_stream_operator_service.cpp", "./src/stream_operator_service.cpp", ] include_dirs = [ "$camera_path/../../interfaces/include", "$camera_path/../../interfaces/hdi_passthrough", "$camera_path/include", "$camera_path/utils/watchdog", "$camera_path/../interfaces", "./include", ] deps = [ "$camera_path/utils:peripheral_camera_utils" ] external_deps = [ "drivers_interface_camera:metadata", "graphic_surface:surface", "hdf_core:libhdf_utils", "hilog_lite:hilog_shared", ] public_configs = [ ":camhdi_impl_config" ] subsystem_name = "hdf" part_name = "drivers_peripheral_camera" } } else { import("//build/ohos.gni") config("camhdi_impl_config") { visibility = [ ":*" ] cflags = [ "-DGST_DISABLE_DEPRECATED", "-DHAVE_CONFIG_H", ] ldflags = [ "-Wl" ] if (enable_camera_device_utest) { cflags += [ "-fprofile-arcs", "-ftest-coverage", ] ldflags += [ "--coverage" ] } } host_sources = [ "$camera_path/../../interfaces/hdi_ipc/camera_host_driver.cpp", "./src/camera_device_service.cpp", "./src/camera_device_service_callback.cpp", "./src/camera_host_service.cpp", "./src/camera_host_service_callback.cpp", "./src/camera_service_type_converter.cpp", "./src/offline_stream_operator_service.cpp", "./src/stream_operator_service.cpp", "./src/stream_operator_service_callback.cpp", ] host_includes = [ "$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/include", "$camera_path/utils/watchdog", "$camera_path/../interfaces", "./include", ] ohos_shared_library("camera_host_service_1.0") { sources = host_sources include_dirs = host_includes deps = [ "$camera_path/utils:peripheral_camera_utils" ] defines = [] if (enable_camera_device_utest) { defines += [ "CAMERA_DEVICE_UTEST" ] } if (use_hitrace) { defines += [ "HITRACE_LOG_ENABLED" ] } if (drivers_peripheral_camera_feature_usb) { defines += [ "CHIP_PROD_CAMERA_HOST_CONFIG" ] } if (is_standard_system) { external_deps = [ "c_utils:utils", "graphic_surface:surface", "hdf_core:libhdf_host", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_single", ] } else { external_deps = [ "hilog:libhilog" ] } if (use_hitrace) { external_deps += [ "hitrace:hitrace_meter" ] } external_deps += [ "drivers_interface_camera:libcamera_stub_1.0", "drivers_interface_camera:metadata", "ipc:ipc_single", ] shlib_type = "hdi" public_configs = [ ":camhdi_impl_config" ] install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_camera" } ohos_static_library("camera_host_service_1.0_static") { sources = host_sources include_dirs = host_includes deps = [ "$camera_path/utils:peripheral_camera_utils" ] defines = [] if (enable_camera_device_utest) { defines += [ "CAMERA_DEVICE_UTEST" ] } if (use_hitrace) { defines += [ "HITRACE_LOG_ENABLED" ] } if (is_standard_system) { external_deps = [ "c_utils:utils", "graphic_surface:surface", "hdf_core:libhdf_host", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_single", ] } else { external_deps = [ "hilog:libhilog" ] } if (use_hitrace) { external_deps += [ "hitrace:hitrace_meter" ] } external_deps += [ "drivers_interface_camera:libcamera_stub_1.0", "drivers_interface_camera:metadata", "ipc:ipc_single", ] public_configs = [ ":camhdi_impl_config" ] subsystem_name = "hdf" part_name = "drivers_peripheral_camera" } }