1# Copyright (c) 2024 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_surface/graphic_surface_config.gni") 16 17if (graphic_2d_ext_delegator && graphic_2d_ext_delegator_gni != "") { 18 import("${graphic_2d_ext_delegator_gni}") 19} 20 21## Build surface.so {{{ 22config("surface_config") { 23 visibility = [ ":*" ] 24 25 include_dirs = [ "include" ] 26 27 if (graphic_2d_ext_delegator && defined(vendor_root)) { 28 include_dirs += libsurface_ext_delegator_include_dirs 29 } 30 31 cflags = [ 32 "-Wall", 33 "-Werror", 34 "-g3", 35 ] 36} 37 38config("surface_public_config") { 39 include_dirs = [ 40 "$graphic_surface_root/utils/frame_report/export", 41 "$graphic_surface_root/surface/include", 42 "$graphic_surface_root/interfaces/inner_api", 43 "$graphic_surface_root/interfaces/inner_api/surface", 44 "$graphic_surface_root/interfaces/inner_api/common", 45 "$graphic_surface_root/interfaces/inner_api/utils", 46 "$graphic_surface_root/sandbox", 47 "$graphic_surface_root/utils/rs_frame_report_ext/include", 48 "$graphic_surface_root/utils/trace", 49 ] 50 51 cflags = [ "-Wno-error=deprecated-declarations" ] 52} 53 54config("surface_headers_config") { 55 include_dirs = [ "$graphic_surface_root/interfaces/inner_api/surface" ] 56} 57 58ohos_static_library("surface_headers") { 59 public_configs = [ ":surface_headers_config" ] 60 part_name = "graphic_surface" 61 subsystem_name = "graphic" 62} 63 64ohos_shared_library("surface") { 65 deps = [ ":surface_static" ] 66 67 sanitize = { 68 boundary_sanitize = true 69 integer_overflow = true 70 ubsan = true 71 } 72 73 public_configs = [ ":surface_public_config" ] 74 75 external_deps = [ 76 "c_utils:utils", 77 "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_3", 78 "drivers_interface_display:libdisplay_buffer_proxy_1.0", 79 "drivers_interface_display:libdisplay_commontype_proxy_1.0", 80 "drivers_interface_display:libdisplay_commontype_proxy_1.1", 81 "drivers_interface_display:libdisplay_commontype_proxy_2.0", 82 "drivers_interface_display:libdisplay_commontype_proxy_2.1", 83 "eventhandler:libeventhandler", 84 "hilog:libhilog", 85 "hitrace:hitrace_meter", 86 "init:libbegetutil", 87 "ipc:ipc_capi", 88 ] 89 if (!is_arkui_x) { 90 public_external_deps = [ "ipc:ipc_single" ] 91 } 92 symlink_target_name = [ 93 "libnative_buffer.so", 94 "libnative_window.so", 95 ] 96 97 innerapi_tags = [ 98 "chipsetsdk_sp", 99 "platformsdk", 100 ] 101 102 part_name = "graphic_surface" 103 subsystem_name = "graphic" 104} 105 106ohos_static_library("surface_static") { 107 sources = [ 108 "src/buffer_client_producer.cpp", 109 "src/buffer_extra_data_impl.cpp", 110 "src/buffer_queue.cpp", 111 "src/buffer_queue_consumer.cpp", 112 "src/buffer_queue_producer.cpp", 113 "src/buffer_utils.cpp", 114 "src/consumer_surface.cpp", 115 "src/consumer_surface_delegator.cpp", 116 "src/metadata_helper.cpp", 117 "src/native_buffer.cpp", 118 "src/native_window.cpp", 119 "src/producer_surface.cpp", 120 "src/producer_surface_delegator.cpp", 121 "src/surface_buffer_impl.cpp", 122 "src/surface_delegate.cpp", 123 "src/surface_tunnel_handle.cpp", 124 "src/surface_utils.cpp", 125 "src/transact_surface_delegator_proxy.cpp", 126 "src/transact_surface_delegator_stub.cpp", 127 ] 128 129 configs = [ ":surface_config" ] 130 131 public_configs = [ ":surface_public_config" ] 132 133 deps = [ 134 "$graphic_surface_root/buffer_handle:buffer_handle", 135 "$graphic_surface_root/sandbox:sandbox_utils", 136 "$graphic_surface_root/sync_fence:sync_fence", 137 "$graphic_surface_root/utils/frame_report:frame_report", 138 "$graphic_surface_root/utils/hebc_white_list:hebc_white_list", 139 "$graphic_surface_root/utils/rs_frame_report_ext:rs_frame_report_ext_surface", 140 ] 141 142 external_deps = [ 143 "c_utils:utils", 144 "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_3", 145 "drivers_interface_display:libdisplay_buffer_proxy_1.0", 146 "drivers_interface_display:libdisplay_commontype_proxy_1.0", 147 "drivers_interface_display:libdisplay_commontype_proxy_1.1", 148 "drivers_interface_display:libdisplay_commontype_proxy_2.0", 149 "drivers_interface_display:libdisplay_commontype_proxy_2.1", 150 "eventhandler:libeventhandler", 151 "hilog:libhilog", 152 "hitrace:hitrace_meter", 153 "init:libbegetutil", 154 "ipc:ipc_capi", 155 "ipc:ipc_single", 156 ] 157 158 if (graphic_2d_ext_delegator && defined(vendor_root)) { 159 sources += libsurface_ext_delegator_sources 160 sources -= libsurface_ext_delegator_sources_del 161 external_deps += libsurface_ext_delegator_external_deps 162 } 163 164 if (graphic_surface_feature_tv_metadata_enable) { 165 defines = [ "RS_ENABLE_TV_PQ_METADATA" ] 166 } 167 168 part_name = "graphic_surface" 169 subsystem_name = "graphic" 170} 171 172## Build surface.so }}} 173 174