• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
2
3import("../camera.gni")
4
5if (defined(ohos_lite)) {
6  import("//build/ohos.gni")
7  config("buffer_manager_config") {
8    visibility = [ ":*" ]
9    cflags = [
10      "-Wall",
11      "-Wextra",
12      "-Werror",
13      "-DGST_DISABLE_DEPRECATED",
14      "-DHAVE_CONFIG_H",
15      "-fno-strict-aliasing",
16      "-Wno-sign-compare",
17      "-Wno-builtin-requires-header",
18      "-Wno-implicit-function-declaration",
19      "-Wno-format",
20      "-Wno-int-conversion",
21      "-Wno-unused-function",
22      "-Wno-thread-safety-attributes",
23      "-Wno-inconsistent-missing-override",
24      "-fno-rtti",
25      "-fno-exceptions",
26      "-ffunction-sections",
27      "-fdata-sections",
28    ]
29
30    cflags_cc = [ "-std=c++17" ]
31    ldflags = [ "-Wl" ]
32    ldflags += [ "--coverage" ]
33  }
34
35  ohos_shared_library("camera_buffer_manager") {
36    sources = [
37      "src/buffer_adapter/lite/buffer_adapter.cpp",
38      "src/buffer_allocator.cpp",
39      "src/buffer_allocator_factory.cpp",
40      "src/buffer_allocator_utils.cpp",
41      "src/buffer_loop_tracking.cpp",
42      "src/buffer_manager.cpp",
43      "src/buffer_pool.cpp",
44      "src/buffer_tracking.cpp",
45      "src/heap_buffer_allocator/heap_buffer_allocator.cpp",
46      "src/image_buffer.cpp",
47    ]
48
49    include_dirs = [
50      "include",
51      "$camera_path/include",
52      "src/buffer_adapter/lite",
53      "//utils/native/base/include",
54      "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
55      "//drivers/peripheral/display/interfaces/include",
56      "//drivers/peripheral/base",
57    ]
58
59    libs = []
60    defines = []
61    deps = [
62      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
63      "//foundation/graphic/surface:surface",
64    ]
65    external_deps = [
66      "device_driver_framework:libhdf_utils",
67      "display_device_driver:hdi_display",
68    ]
69
70    public_configs = [ ":buffer_manager_config" ]
71    subsystem_name = "hdf"
72    part_name = "camera_device_driver"
73  }
74} else {
75  import("//build/ohos.gni")
76  config("buffer_manager_config") {
77    visibility = [ ":*" ]
78
79    cflags = [
80      "-Wall",
81      "-Wextra",
82      "-Werror",
83      "-DGST_DISABLE_DEPRECATED",
84      "-DHAVE_CONFIG_H",
85      "-fno-strict-aliasing",
86      "-Wno-sign-compare",
87      "-Wno-builtin-requires-header",
88      "-Wno-implicit-function-declaration",
89      "-Wno-format",
90      "-Wno-int-conversion",
91      "-Wno-unused-function",
92      "-Wno-thread-safety-attributes",
93      "-Wno-inconsistent-missing-override",
94      "-fno-rtti",
95      "-fno-exceptions",
96      "-ffunction-sections",
97      "-fdata-sections",
98    ]
99
100    ldflags = [ "-Wl" ]
101
102    if (enable_camera_device_utest) {
103      cflags += [
104        "-fprofile-arcs",
105        "-ftest-coverage",
106      ]
107
108      ldflags += [ "--coverage" ]
109    }
110  }
111
112  ohos_shared_library("camera_buffer_manager") {
113    sources = [
114      "src/buffer_adapter/standard/buffer_adapter.cpp",
115      "src/buffer_allocator.cpp",
116      "src/buffer_allocator_factory.cpp",
117      "src/buffer_allocator_utils.cpp",
118      "src/buffer_loop_tracking.cpp",
119      "src/buffer_manager.cpp",
120      "src/buffer_pool.cpp",
121      "src/buffer_tracking.cpp",
122      "src/gralloc_buffer_allocator/gralloc_buffer_allocator.cpp",
123      "src/heap_buffer_allocator/heap_buffer_allocator.cpp",
124      "src/image_buffer.cpp",
125    ]
126
127    include_dirs = [
128      "include",
129      "src/buffer_adapter/standard",
130      "$camera_path/include",
131      "//utils/native/base/include",
132    ]
133
134    libs = []
135
136    defines = []
137
138    if (enable_camera_device_utest) {
139      defines += [ "CAMERA_DEVICE_UTEST" ]
140    }
141
142    if (is_standard_system) {
143      external_deps = [
144        "device_driver_framework:libhdf_utils",
145        "display_device_driver:hdi_display_gralloc",
146        "graphic_standard:surface",
147        "hiviewdfx_hilog_native:libhilog",
148        "utils_base:utils",
149      ]
150    } else {
151      external_deps = [ "hilog:libhilog" ]
152    }
153
154    public_configs = [ ":buffer_manager_config" ]
155    install_images = [ chipset_base_dir ]
156    subsystem_name = "hdf"
157    part_name = "camera_device_driver"
158  }
159}
160