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") 16 17## Build surface.so {{{ 18config("surface_config") { 19 visibility = [ ":*" ] 20 21 include_dirs = [ "include" ] 22 23 cflags = [ 24 "-Wall", 25 "-Werror", 26 "-g3", 27 ] 28} 29 30config("surface_public_config") { 31 include_dirs = [ 32 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 33 "$graphic_2d_root/interfaces/inner_api/surface", 34 "$graphic_2d_root/interfaces/inner_api/common", 35 "$graphic_2d_root/utils/sandbox", 36 ] 37 38 if (defined(graphic_2d_ext_configs.vendor_root)) { 39 include_dirs += graphic_2d_ext_configs.libsurface_ext_include_dirs 40 } 41 42 defines = [] 43 if (ace_enable_gpu) { 44 defines = [ "ACE_ENABLE_GPU" ] 45 } 46 if (graphic_2d_feature_freemem_enable) { 47 defines += [ "SURFACE_ENABLE_FREEMEM" ] 48 } 49 defines += gpu_defines 50 51 cflags = [ "-Wno-error=deprecated-declarations" ] 52} 53 54ohos_shared_library("surface") { 55 sources = [ 56 "src/buffer_client_producer.cpp", 57 "src/buffer_extra_data_impl.cpp", 58 "src/buffer_manager.cpp", 59 "src/buffer_queue.cpp", 60 "src/buffer_queue_consumer.cpp", 61 "src/buffer_queue_producer.cpp", 62 "src/buffer_utils.cpp", 63 "src/consumer_surface.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_2d_root/utils/gslogger:libgslogger", 82 "$graphic_2d_root/utils/sync_fence:sync_fence", 83 ] 84 85 public_deps = [ 86 "$graphic_2d_root/utils/buffer_handle:buffer_handle", 87 "$graphic_2d_root/utils/sandbox:sandbox_utils", 88 "$graphic_2d_root/utils/scoped_bytrace:scoped_bytrace", 89 "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client", 90 ] 91 92 external_deps = [ 93 "c_utils:utils", 94 "drivers_interface_display:display_buffer_idl_headers", 95 "drivers_interface_display:libdisplay_buffer_hdi_impl", 96 "hilog:libhilog", 97 "hitrace:hitrace_meter", 98 "ipc:ipc_single", 99 ] 100 101 symlink_target_name = [ 102 "libnative_buffer.so", 103 "libnative_window.so", 104 ] 105 106 if (defined(graphic_2d_ext_configs.vendor_root)) { 107 sources += graphic_2d_ext_configs.libsurface_ext_sources 108 sources -= graphic_2d_ext_configs.libsurface_ext_sources_del 109 110 public_deps += [ "//foundation/graphic/graphic_2d_ext/ohcore/graphic_compat_layer:libgraphic_compat_layer" ] 111 112 public_deps -= [ "//drivers/peripheral/display/hdi_service/gralloc/client:hdi_gralloc_client" ] 113 } 114 115 innerapi_tags = [ 116 "chipsetsdk", 117 "platformsdk", 118 ] 119 part_name = "graphic_2d" 120 subsystem_name = "graphic" 121} 122 123## Build surface.so }}} 124 125