• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
2import("//build/ohos.gni")
3import("../camera.gni")
4
5print("${target_cpu}")
6target_product = getenv("TARGET_PRODUCT")
7target_product =
8    exec_script("/usr/bin/python3",
9                [
10                  "-c",
11                  "import sys; print('${target_product}'.lower(), end='')",
12                ],
13                "string")
14print("buffer manager use target: ${target_product}")
15
16config("buffer_manager_config") {
17  visibility = [ ":*" ]
18
19  cflags = [
20    "-Wall",
21    "-Wextra",
22    "-Werror",
23    "-DGST_DISABLE_DEPRECATED",
24    "-DHAVE_CONFIG_H",
25    "-fno-strict-aliasing",
26    "-Wno-sign-compare",
27    "-Wno-builtin-requires-header",
28    "-Wno-implicit-function-declaration",
29    "-Wno-format",
30    "-Wno-int-conversion",
31    "-Wno-unused-function",
32    "-Wno-thread-safety-attributes",
33    "-Wno-inconsistent-missing-override",
34    "-fno-rtti",
35    "-fno-exceptions",
36    "-ffunction-sections",
37    "-fdata-sections",
38  ]
39
40  ldflags = [ "-Wl" ]
41
42  if (enable_camera_device_utest) {
43    cflags += [
44      "-fprofile-arcs",
45      "-ftest-coverage",
46    ]
47
48    ldflags += [ "--coverage" ]
49  }
50}
51
52ohos_shared_library("camera_buffer_manager") {
53  sources = [
54    "src/buffer_adapter.cpp",
55    "src/buffer_allocator.cpp",
56    "src/buffer_allocator_factory.cpp",
57    "src/buffer_allocator_utils.cpp",
58    "src/buffer_loop_tracking.cpp",
59    "src/buffer_manager.cpp",
60    "src/buffer_pool.cpp",
61    "src/buffer_tracking.cpp",
62    "src/gralloc_buffer_allocator/gralloc_buffer_allocator.cpp",
63    "src/heap_buffer_allocator/heap_buffer_allocator.cpp",
64    "src/image_buffer.cpp",
65  ]
66
67  include_dirs = [
68    "include",
69    "$camera_path/include",
70    "//utils/native/base/include",
71    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
72    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
73    "//drivers/framework/include/utils",
74    "//drivers/adapter/uhdf2/osal/include",
75  ]
76
77  libs = []
78
79  defines = []
80
81  deps = [
82    "//drivers/peripheral/display/hal:hdi_display_gralloc",
83    "//foundation/graphic/standard:libsurface",
84    "//utils/native/base:utils",
85  ]
86
87  if (enable_camera_device_utest) {
88    defines += [ "CAMERA_DEVICE_UTEST" ]
89  }
90
91  if (is_standard_system) {
92    external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
93  } else {
94    external_deps = [ "hilog:libhilog" ]
95  }
96
97  public_configs = [ ":buffer_manager_config" ]
98  subsystem_name = "hdf"
99  part_name = "hdf"
100}
101