1# Copyright (c) 2021 - 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 config("buffer_manager_config") { 19 visibility = [ ":*" ] 20 cflags = [ 21 "-DGST_DISABLE_DEPRECATED", 22 "-DHAVE_CONFIG_H", 23 ] 24 25 cflags_cc = [ "-std=c++17" ] 26 ldflags = [ "-Wl" ] 27 ldflags += [ "--coverage" ] 28 29 include_dirs = [ "./include" ] 30 } 31 32 ohos_shared_library("peripheral_camera_buffer_manager") { 33 sources = [ 34 "./src/buffer_adapter/lite/buffer_adapter.cpp", 35 "./src/buffer_allocator.cpp", 36 "./src/buffer_allocator_factory.cpp", 37 "./src/buffer_allocator_utils.cpp", 38 "./src/buffer_loop_tracking.cpp", 39 "./src/buffer_manager.cpp", 40 "./src/buffer_pool.cpp", 41 "./src/buffer_tracking.cpp", 42 "./src/heap_buffer_allocator/heap_buffer_allocator.cpp", 43 "./src/image_buffer.cpp", 44 ] 45 46 include_dirs = [ 47 "./include", 48 "$camera_path/include", 49 "./src/buffer_adapter/lite", 50 "$camera_path/../../display/interfaces/include", 51 "$camera_path/../../base", 52 "$camera_path/../../interfaces/include", 53 ] 54 55 libs = [] 56 defines = [] 57 external_deps = [ 58 "drivers_peripheral_display:hdi_display", 59 "graphic_surface:buffer_handle", 60 "graphic_surface:surface", 61 "hdf_core:libhdf_utils", 62 "hilog_lite:hilog_shared", 63 ] 64 65 public_configs = [ ":buffer_manager_config" ] 66 subsystem_name = "hdf" 67 part_name = "drivers_peripheral_camera" 68 } 69} else { 70 import("//build/ohos.gni") 71 config("buffer_manager_config") { 72 visibility = [ ":*" ] 73 74 cflags = [ 75 "-DGST_DISABLE_DEPRECATED", 76 "-DHAVE_CONFIG_H", 77 ] 78 79 ldflags = [ "-Wl" ] 80 81 if (enable_camera_device_utest) { 82 cflags += [ 83 "-fprofile-arcs", 84 "-ftest-coverage", 85 ] 86 87 ldflags += [ "--coverage" ] 88 } 89 90 include_dirs = [ "./include" ] 91 } 92 93 ohos_shared_library("peripheral_camera_buffer_manager") { 94 sources = [ 95 "./src/buffer_adapter/standard/buffer_adapter.cpp", 96 "./src/buffer_allocator.cpp", 97 "./src/buffer_allocator_factory.cpp", 98 "./src/buffer_allocator_utils.cpp", 99 "./src/buffer_loop_tracking.cpp", 100 "./src/buffer_manager.cpp", 101 "./src/buffer_pool.cpp", 102 "./src/buffer_tracking.cpp", 103 "./src/heap_buffer_allocator/heap_buffer_allocator.cpp", 104 "./src/image_buffer.cpp", 105 ] 106 107 include_dirs = [ 108 "./src/buffer_adapter/standard", 109 "$camera_path/include", 110 "$camera_path/../../interfaces/include", 111 "$camera_path/utils/event", 112 ] 113 114 libs = [] 115 116 defines = [] 117 118 if (enable_camera_device_utest) { 119 defines += [ "CAMERA_DEVICE_UTEST" ] 120 } 121 deps = [ "$camera_path/utils:peripheral_camera_utils" ] 122 if (is_standard_system) { 123 external_deps = [ 124 "c_utils:utils", 125 "graphic_surface:buffer_handle", 126 "graphic_surface:surface", 127 "hdf_core:libhdf_utils", 128 "hilog:libhilog", 129 "hisysevent:libhisysevent", 130 ] 131 } else { 132 external_deps = [ "hilog:libhilog" ] 133 } 134 external_deps += [ "drivers_interface_camera:metadata" ] 135 public_configs = [ ":buffer_manager_config" ] 136 install_images = [ chipset_base_dir ] 137 subsystem_name = "hdf" 138 part_name = "drivers_peripheral_camera" 139 } 140} 141