1# Copyright (c) 2024 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") 15 16config("export_config") { 17 include_dirs = [ "include" ] 18 cflags_cc = [ "-std=c++17" ] 19} 20 21ohos_source_set("graphics_effect_src") { 22 branch_protector_ret = "pac_ret" 23 sanitize = { 24 cfi = true 25 cfi_cross_dso = true 26 debug = false 27 } 28 cflags = [ 29 "-O2", 30 "-ftrapv", 31 "-FPIC", 32 "-FS", 33 "-D_FORTIFY_SOURCE=2", 34 "-fvisibility=hidden", 35 "-fdata-sections", 36 "-ffunction-sections", 37 "-flto", 38 ] 39 cflags_cc = [ 40 "-std=c++17", 41 "-O2", 42 "-ftrapv", 43 "-FPIC", 44 "-FS", 45 "-D_FORTIFY_SOURCE=2", 46 "-fvisibility=hidden", 47 "-fvisibility-inlines-hidden", 48 "-fdata-sections", 49 "-ffunction-sections", 50 "-flto", 51 ] 52 53 public_configs = [ ":export_config" ] 54 include_dirs = [ 55 "include", 56 ] 57 58 sources = [ 59 "src/ext/gex_dot_matrix_shader.cpp", 60 "src/ext/gex_flow_light_sweep_shader.cpp", 61 "src/ext/gex_marshalling_helper.cpp", 62 "src/ge_aibar_shader_filter.cpp", 63 "src/ge_external_dynamic_loader.cpp", 64 "src/ge_grey_shader_filter.cpp", 65 "src/ge_kawase_blur_shader_filter.cpp", 66 "src/ge_linear_gradient_blur_shader_filter.cpp", 67 "src/ge_magnifier_shader_filter.cpp", 68 "src/ge_mesa_blur_shader_filter.cpp", 69 "src/ge_render.cpp", 70 "src/ge_system_properties.cpp", 71 "src/ge_visual_effect.cpp", 72 "src/ge_visual_effect_container.cpp", 73 "src/ge_visual_effect_impl.cpp", 74 "src/ge_water_ripple_filter.cpp", 75 ] 76 77 external_deps = [ 78 "graphic_2d:2d_graphics", 79 "c_utils:utils", 80 ] 81 82 if (is_arkui_x) { 83 deps += [ 84 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 85 "//third_party/bounds_checking_function:libsec_static", 86 "//third_party/skia:skia_$target_os", 87 ] 88 external_deps += [ "hilog:libhilog" ] 89 } else { 90 external_deps += [ 91 "bounds_checking_function:libsec_static", 92 "hilog:libhilog", 93 "skia:skia_canvaskit", 94 ] 95 } 96 97 defines = [] 98 if (current_os == "ohos") { 99 defines += [ "GE_OHOS" ] 100 external_deps += [ "init:libbegetutil" ] 101 } 102 103 if (is_mingw || is_win) { 104 defines += [ "GE_PLATFORM_WIN" ] 105 } else { 106 defines += [ "GE_PLATFORM_UNIX" ] 107 } 108 109 output_name = "graphics_effect" 110 part_name = "graphics_effect" 111 subsystem_name = "graphic" 112} 113 114if (is_arkui_x) { 115 ohos_source_set("libgraphics_effect") { 116 branch_protector_ret = "pac_ret" 117 sanitize = { 118 cfi = true 119 cfi_cross_dso = true 120 debug = false 121 } 122 123 deps = [ 124 ":graphics_effect_src", 125 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_${target_os}", 126 "//third_party/bounds_checking_function:libsec_static", 127 "//third_party/skia:skia_$target_os", 128 ] 129 130 part_name = "graphics_effect" 131 subsystem_name = "graphic" 132 } 133} else { 134 ohos_shared_library("graphics_effect_core") { 135 branch_protector_ret = "pac_ret" 136 sanitize = { 137 cfi = true 138 cfi_cross_dso = true 139 debug = false 140 } 141 142 public_configs = [ ":export_config" ] 143 144 deps = [ ":graphics_effect_src" ] 145 external_deps = [ 146 "bounds_checking_function:libsec_static", 147 "hilog:libhilog", 148 "skia:skia_canvaskit", 149 ] 150 151 output_name = "graphics_effect" 152 part_name = "graphics_effect" 153 subsystem_name = "graphic" 154 } 155} 156