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 libnative_image.so {{{ 18config("native_image_config") { 19 visibility = [ ":*" ] 20 21 cflags = [ 22 "-Wall", 23 "-Werror", 24 "-g3", 25 ] 26} 27 28config("libnative_image_public_config") { 29 include_dirs = [ 30 "$graphic_2d_root/utils/sandbox", 31 "$graphic_2d_root/interfaces/inner_api/surface", 32 "include", 33 ] 34} 35 36ohos_shared_library("libnative_image") { 37 sanitize = { 38 boundary_sanitize = true 39 integer_overflow = true 40 ubsan = true 41 } 42 sources = [] 43 if (surface_enable_gpu) { 44 sources += [ 45 "src/native_image.cpp", 46 "src/surface_image.cpp", 47 ] 48 49 if (defined(graphic_2d_ext_configs.vendor_root)) { 50 sources += graphic_2d_ext_configs.libnative_image_ext_sources 51 sources -= graphic_2d_ext_configs.libnative_image_ext_sources_del 52 } 53 } 54 55 configs = [ ":native_image_config" ] 56 57 public_configs = [ ":libnative_image_public_config" ] 58 59 deps = [ 60 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 61 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 62 ] 63 64 output_extension = "so" 65 66 external_deps = [ 67 "c_utils:utils", 68 "graphic_surface:surface", 69 "graphic_surface:sync_fence", 70 "hilog:libhilog", 71 "ipc:ipc_single", 72 ] 73 74 part_name = "graphic_2d" 75 subsystem_name = "graphic" 76} 77## Build libnative_image.so }}} 78