1# Copyright (c) 2022 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 libskeffectchain.so 18 19config("effect_SKeffectChian_config") { 20 cflags = [ 21 "-Wall", 22 "-Werror", 23 "-g3", 24 "-Wall", 25 "-Wno-pointer-arith", 26 "-Wno-non-virtual-dtor", 27 "-Wno-missing-field-initializers", 28 "-Wno-c++11-narrowing", 29 ] 30 include_dirs = 31 [ "$graphic_2d_root/rosen/modules/render_service_base/include" ] 32} 33 34config("effect_SKeffectChian_public_config") { 35 include_dirs = [ 36 "../egl/include", 37 "$graphic_2d_root/utils/log", 38 "include", 39 ] 40 41 if (is_arkui_x) { 42 include_dirs += [ 43 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include", 44 "//foundation/multimedia/image_framework/interfaces/innerkits/include", 45 "//foundation/graphic/graphic_2d/utils/color_manager/export", 46 "//base/hiviewdfx/hilog/interfaces/native/innerkits", 47 ] 48 } 49} 50if (is_arkui_x) { 51 ohos_source_set("skeffectchain") { 52 public_deps = [ 53 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 54 "//foundation/arkui/ace_engine/adapter/${target_os}/build:libarkui_${target_os}", 55 ] 56 57 if (target_os == "android") { 58 defines = [ "ANDROID_PLATFORM" ] 59 } else if (target_os == "ios") { 60 defines = [ "IOS_PLATFORM" ] 61 } 62 63 if (target_os == "android") { 64 public_deps += 65 [ "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect" ] 66 67 if (rs_enable_gpu) { 68 defines += [ "RS_ENABLE_GPU" ] 69 defines += gpu_defines 70 public_deps += [ 71 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 72 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 73 ] 74 } 75 } 76 77 public_external_deps = [ 78 "c_utils:utilsbase", 79 "skia:skia_canvaskit_static", 80 ] 81 82 sources = [ 83 "src/sk_image_chain.cpp", 84 "src/sk_image_filter_factory.cpp", 85 ] 86 87 configs = [ ":effect_SKeffectChian_config" ] 88 89 public_configs = [ ":effect_SKeffectChian_public_config" ] 90 91 cflags_cc = [ "-std=c++17" ] 92 93 part_name = "graphic_2d" 94 subsystem_name = "graphic" 95 } 96} else { 97 ohos_shared_library("skeffectchain") { 98 public_deps = [ "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect" ] 99 100 if (rs_enable_gpu) { 101 defines = gpu_defines 102 public_deps += [ 103 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 104 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 105 ] 106 } 107 108 public_external_deps = [ 109 "graphic_surface:surface", 110 "skia:skia_canvaskit", 111 ] 112 113 external_deps = [ 114 "c_utils:utils", 115 "hilog:libhilog", 116 "hitrace:hitrace_meter", 117 "image_framework:image", 118 "image_framework:image_native", 119 "image_framework:pixelconvertadapter", 120 "init:libbegetutil", 121 "ipc:ipc_core", 122 "napi:ace_napi", 123 "samgr:samgr_proxy", 124 ] 125 126 sources = [ 127 "src/sk_image_chain.cpp", 128 "src/sk_image_filter_factory.cpp", 129 ] 130 131 configs = [ ":effect_SKeffectChian_config" ] 132 133 public_configs = [ ":effect_SKeffectChian_public_config" ] 134 135 deps = [ "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base" ] 136 137 cflags_cc = [ "-std=c++17" ] 138 139 install_enable = true 140 part_name = "graphic_2d" 141 subsystem_name = "graphic" 142 } 143} 144