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