1# Copyright (c) 2022 - 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("../../../camera.gni")
15
16if (!defined(ohos_lite)) {
17  import("//build/ohos.gni")
18
19  config("camera_metadata_manager_config") {
20    visibility = [ ":*" ]
21    cflags = [
22      "-DGST_DISABLE_DEPRECATED",
23      "-DHAVE_CONFIG_H",
24    ]
25
26    if (enable_camera_device_utest) {
27      cflags += [
28        "-fprofile-arcs",
29        "-ftest-coverage",
30      ]
31
32      ldflags += [ "--coverage" ]
33    }
34
35    include_dirs = [ "./include" ]
36  }
37
38  ohos_shared_library("peripheral_camera_metadata_manager") {
39    defines = []
40    if (drivers_peripheral_camera_feature_usb) {
41      defines += [ "CAMERA_BUILT_ON_USB" ]
42    }
43    sources = [
44      "$camera_path/dump/src/camera_dump.cpp",
45      "$camera_path/metadata_manager/src/metadata_config.cpp",
46      "$camera_path/metadata_manager/src/metadata_controller.cpp",
47    ]
48    include_dirs = [
49      "$camera_path/../../interfaces/include",
50      "$camera_path/device_manager/include",
51      "$camera_path/metadata_manager/include",
52      "$camera_path/dump/include",
53      "$camera_path/../interfaces",
54    ]
55
56    deps = [ "$camera_path/device_manager:peripheral_camera_device_manager" ]
57
58    if (is_standard_system) {
59      external_deps = [
60        "graphic_surface:surface",
61        "hdf_core:libhdf_host",
62        "hdf_core:libhdf_ipc_adapter",
63        "hdf_core:libhdf_utils",
64        "hdf_core:libhdi",
65        "hilog:libhilog",
66        "ipc:ipc_single",
67      ]
68      if (use_hitrace) {
69        external_deps += [ "hitrace:hitrace_meter" ]
70      }
71    } else {
72      external_deps = [ "hilog:libhilog" ]
73    }
74    external_deps += [
75      "bounds_checking_function:libsec_shared",
76      "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
77      "drivers_interface_camera:metadata",
78      "ipc:ipc_single",
79    ]
80
81    public_configs = [ ":camera_metadata_manager_config" ]
82    install_images = [ chipset_base_dir ]
83    subsystem_name = "hdf"
84    part_name = "drivers_peripheral_camera"
85  }
86
87  ohos_shared_library("camera_example_vendor_tag_impl") {
88    install_enable = false
89    cflags = [
90      "-fPIC",
91      "-Wall",
92    ]
93    cflags_cc = cflags
94    include_dirs = [ "./include" ]
95    sources = [ "src/camera_example_vendor_tags.cpp" ]
96    external_deps = [ "drivers_interface_camera:metadata" ]
97
98    part_name = "drivers_peripheral_camera"
99    subsystem_name = "hdf"
100  }
101}
102