# 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", "//foundation/graphic/graphic_2d/interfaces/inner_api/surface", "//foundation/graphic/graphic_2d/interfaces/inner_api/common", "//foundation/graphic/graphic_2d/utils/sandbox", ] if (defined(graphic_2d_ext_configs.vendor_root)) { include_dirs += graphic_2d_ext_configs.libsurface_ext_include_dirs } defines = [] if (ace_enable_gpu) { defines = [ "ACE_ENABLE_GPU" ] } if (graphic_standard_feature_freemem_enable) { defines += [ "SURFACE_ENABLE_FREEMEM" ] } 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_manager.cpp", "src/buffer_queue.cpp", "src/buffer_queue_consumer.cpp", "src/buffer_queue_producer.cpp", "src/buffer_utils.cpp", "src/consumer_surface.cpp", "src/native_buffer.cpp", "src/native_window.cpp", "src/producer_surface.cpp", "src/surface.cpp", "src/surface_buffer_impl.cpp", "src/surface_delegate.cpp", "src/surface_tunnel_handle.cpp", "src/surface_utils.cpp", ] configs = [ ":surface_config" ] public_configs = [ ":surface_public_config", "//commonlibrary/c_utils/base:utils_config", ] deps = [ "//foundation/graphic/graphic_2d/utils/sync_fence:sync_fence" ] public_deps = [ "//commonlibrary/c_utils/base:utils", "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client", "//foundation/graphic/graphic_2d/utils/buffer_handle:buffer_handle", "//foundation/graphic/graphic_2d/utils/sandbox:sandbox_utils", "//foundation/graphic/graphic_2d/utils/scoped_bytrace:scoped_bytrace", "//third_party/EGL:libEGL", "//third_party/openGLES:libGLES", ] external_deps = [ "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", ] symlink_target_name = [ "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" ] } part_name = "graphic_standard" subsystem_name = "graphic" } ## Build surface.so }}}