• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//build/ohos.gni")
15import("//foundation/graphic/graphic_2d/graphic_config.gni")
16import("//foundation/graphic/graphic_surface/graphic_surface_config.gni")
17
18## Build surface.so {{{
19config("surface_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [ "include" ]
23
24  cflags = [
25    "-Wall",
26    "-Werror",
27    "-g3",
28  ]
29}
30
31config("surface_public_config") {
32  include_dirs = [
33    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
34    "//foundation/graphic/graphic_surface/interfaces/inner_api/surface",
35    "//foundation/graphic/graphic_surface/interfaces/inner_api/common",
36    "//foundation/graphic/graphic_surface/interfaces/inner_api/utils",
37    "//foundation/graphic/graphic_surface/sandbox",
38    "//foundation/graphic/graphic_surface/scoped_bytrace/include",
39  ]
40
41  defines = []
42  if (graphic_2d_feature_freemem_enable) {
43    defines += [ "SURFACE_ENABLE_FREEMEM" ]
44  }
45  if (graphic_2d_feature_drivers_interface_display_enable) {
46    defines += [ "DRIVERS_INTERFACE_DISPLAY_ENABLE" ]
47  }
48  defines += gpu_defines
49
50  cflags = [ "-Wno-error=deprecated-declarations" ]
51}
52
53ohos_shared_library("surface") {
54  sources = [
55    "src/buffer_client_producer.cpp",
56    "src/buffer_extra_data_impl.cpp",
57    "src/buffer_manager.cpp",
58    "src/buffer_queue.cpp",
59    "src/buffer_queue_consumer.cpp",
60    "src/buffer_queue_producer.cpp",
61    "src/buffer_utils.cpp",
62    "src/consumer_surface.cpp",
63    "src/metadata_helper.cpp",
64    "src/native_buffer.cpp",
65    "src/native_window.cpp",
66    "src/producer_surface.cpp",
67    "src/surface_buffer_impl.cpp",
68    "src/surface_delegate.cpp",
69    "src/surface_tunnel_handle.cpp",
70    "src/surface_utils.cpp",
71  ]
72
73  configs = [ ":surface_config" ]
74
75  public_configs = [
76    ":surface_public_config",
77    "//commonlibrary/c_utils/base:utils_config",
78  ]
79
80  deps = [
81    "$graphic_surface_root/buffer_handle:buffer_handle",
82    "$graphic_surface_root/sandbox:sandbox_utils",
83    "$graphic_surface_root/scoped_bytrace:scoped_bytrace",
84    "$graphic_surface_root/sync_fence:sync_fence",
85  ]
86
87  external_deps = [
88    "c_utils:utils",
89    "drivers_interface_display:display_buffer_idl_headers",
90    "hilog:libhilog",
91    "hitrace:hitrace_meter",
92    "ipc:ipc_single",
93  ]
94
95  if (graphic_2d_feature_drivers_interface_display_enable) {
96    external_deps += [
97      "drivers_interface_display:display_buffer_idl_headers",
98      "drivers_interface_display:display_commontype_idl_headers",
99      "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_1",
100    ]
101  }
102
103  symlink_target_name = [
104    "libnative_buffer.so",
105    "libnative_window.so",
106  ]
107
108  innerapi_tags = [ "chipsetsdk" ]
109  part_name = "graphic_surface"
110  subsystem_name = "graphic"
111}
112
113group("test") {
114  testonly = true
115  deps = [ "test:test" ]
116}
117
118## Build surface.so }}}
119
120