# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/graphic/graphic_surface/graphic_surface_config.gni") if (graphic_2d_ext_delegator && graphic_2d_ext_delegator_gni != "") { import("${graphic_2d_ext_delegator_gni}") } ## Build surface.so {{{ config("surface_config") { visibility = [ ":*" ] include_dirs = [ "include" ] cflags = [ "-Wall", "-Werror", "-g3", ] } config("surface_public_config") { include_dirs = [ "$graphic_surface_root/utils/frame_report/export", "$graphic_surface_root/surface/include", "$graphic_surface_root/interfaces/inner_api", "$graphic_surface_root/interfaces/inner_api/surface", "$graphic_surface_root/interfaces/inner_api/common", "$graphic_surface_root/interfaces/inner_api/utils", "$graphic_surface_root/sandbox", "$graphic_surface_root/utils/rs_frame_report_ext/include", "$graphic_surface_root/utils/trace", ] if (graphic_2d_ext_delegator && defined(vendor_root)) { include_dirs += libsurface_ext_delegator_include_dirs } cflags = [ "-Wno-error=deprecated-declarations" ] } config("surface_headers_config") { include_dirs = [ "$graphic_surface_root/interfaces/inner_api/surface" ] } ohos_static_library("surface_headers") { public_configs = [ ":surface_headers_config" ] part_name = "graphic_surface" subsystem_name = "graphic" } ohos_shared_library("surface") { sanitize = { boundary_sanitize = true integer_overflow = true ubsan = true } sources = [ "src/buffer_client_producer.cpp", "src/buffer_extra_data_impl.cpp", "src/buffer_queue.cpp", "src/buffer_queue_consumer.cpp", "src/buffer_queue_producer.cpp", "src/buffer_utils.cpp", "src/consumer_surface.cpp", "src/consumer_surface_delegator.cpp", "src/metadata_helper.cpp", "src/native_buffer.cpp", "src/native_window.cpp", "src/producer_surface.cpp", "src/producer_surface_delegator.cpp", "src/surface_buffer_impl.cpp", "src/surface_delegate.cpp", "src/surface_tunnel_handle.cpp", "src/surface_utils.cpp", "src/transact_surface_delegator_proxy.cpp", "src/transact_surface_delegator_stub.cpp", ] configs = [ ":surface_config" ] public_configs = [ ":surface_public_config" ] deps = [ "$graphic_surface_root/buffer_handle:buffer_handle", "$graphic_surface_root/sandbox:sandbox_utils", "$graphic_surface_root/sync_fence:sync_fence", "$graphic_surface_root/utils/frame_report:frame_report", "$graphic_surface_root/utils/rs_frame_report_ext:rs_frame_report_ext_surface", ] external_deps = [ "c_utils:utils", "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_2", "drivers_interface_display:libdisplay_buffer_proxy_1.0", "drivers_interface_display:libdisplay_commontype_proxy_1.0", "drivers_interface_display:libdisplay_commontype_proxy_1.1", "eventhandler:libeventhandler", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_capi", "ipc:ipc_single", ] symlink_target_name = [ "libnative_buffer.so", "libnative_window.so", ] if (graphic_2d_ext_delegator && defined(vendor_root)) { sources += libsurface_ext_delegator_sources sources -= libsurface_ext_delegator_sources_del external_deps += libsurface_ext_delegator_external_deps } innerapi_tags = [ "chipsetsdk", "platformsdk", ] part_name = "graphic_surface" subsystem_name = "graphic" } ## Build surface.so }}}