# Copyright (c) 2021 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_2d/graphic_config.gni") ## Build surface.so {{{ config("surface_config") { visibility = [ ":*" ] include_dirs = [ "include" ] cflags = [ "-Wall", "-Werror", "-g3", ] } config("surface_public_config") { include_dirs = [ "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", "$graphic_2d_root/interfaces/inner_api/surface", "$graphic_2d_root/interfaces/inner_api/common", "$graphic_2d_root/utils/frame_report", "$graphic_2d_root/utils/sandbox", ] if (defined(graphic_2d_ext_configs.vendor_root)) { include_dirs += graphic_2d_ext_configs.libsurface_ext_include_dirs } if (defined(graphic_2d_delegator_configs.vendor_root)) { include_dirs += graphic_2d_delegator_configs.libsurface_ext_delegator_include_dirs } defines = [] if (ace_enable_gpu) { defines = [ "ACE_ENABLE_GPU" ] } if (graphic_2d_feature_freemem_enable) { defines += [ "SURFACE_ENABLE_FREEMEM" ] } if (graphic_2d_feature_drivers_interface_display_enable) { defines += [ "DRIVERS_INTERFACE_DISPLAY_ENABLE" ] } defines += gpu_defines cflags = [ "-Wno-error=deprecated-declarations" ] } ohos_shared_library("surface") { 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", "//commonlibrary/c_utils/base:utils_config", ] deps = [ "$graphic_2d_root/utils/sync_fence:sync_fence" ] public_deps = [ "$graphic_2d_root/utils/buffer_handle:buffer_handle", "$graphic_2d_root/utils/frame_report:frame_report", "$graphic_2d_root/utils/sandbox:sandbox_utils", "$graphic_2d_root/utils/scoped_bytrace:scoped_bytrace", ] external_deps = [ "c_utils:utils", "drivers_interface_display:display_buffer_idl_headers", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_single", ] if (graphic_2d_feature_drivers_interface_display_enable) { external_deps += [ "drivers_interface_display:display_buffer_idl_headers", "drivers_interface_display:display_commontype_idl_headers", "drivers_interface_display:libdisplay_buffer_hdi_impl_v1_1", ] } symlink_target_name = [ "libnative_buffer.so", "libnative_window.so", ] if (defined(graphic_2d_ext_configs.vendor_root)) { sources += graphic_2d_ext_configs.libsurface_ext_sources sources -= graphic_2d_ext_configs.libsurface_ext_sources_del public_deps += [ "//foundation/graphic/graphic_2d_ext/ohcore/graphic_compat_layer:libgraphic_compat_layer" ] public_deps -= [ "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client" ] } if (defined(graphic_2d_delegator_configs.vendor_root)) { sources += graphic_2d_delegator_configs.libsurface_ext_delegator_sources sources -= graphic_2d_delegator_configs.libsurface_ext_delegator_sources_del } innerapi_tags = [ "chipsetsdk", "platformsdk", ] part_name = "graphic_2d" subsystem_name = "graphic" } ## Build surface.so }}}