1# Copyright (C) 2025 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/config/components/ets_frontend/ets2abc_config.gni") 15import("//build/ohos.gni") 16import("//build/ohos/taihe_idl/taihe.gni") 17import("//foundation/multimedia/image_framework/ide/image_decode_config.gni") 18 19subsystem_name = "multimedia" 20part_name = "image_framework" 21taihe_generated_file_path = "$taihe_file_path/out/$subsystem_name/$part_name" 22 23config("image_taihe_config") { 24 visibility = [ ":*" ] 25 include_dirs = [ "include" ] 26} 27 28copy_taihe_idl("copy_image_taihe") { 29 sources = [ 30 "${image_subsystem}/frameworks/kits/taihe/idl/ohos.multimedia.image.image.taihe", 31 "${image_subsystem}/frameworks/kits/taihe/idl/ohos.multimedia.image.taihe", 32 ] 33} 34 35ohos_taihe("run_taihe") { 36 taihe_generated_file_path = "$taihe_generated_file_path" 37 deps = [ ":copy_image_taihe" ] 38 outputs = [ 39 "$taihe_generated_file_path/src/ohos.multimedia.image.image.ani.cpp", 40 "$taihe_generated_file_path/src/ohos.multimedia.image.image.abi.c", 41 ] 42} 43 44template("image_taihe_shared_library") { 45 target_name = invoker.target_name 46 extra_sources = [] 47 if (defined(invoker.extra_sources)) { 48 extra_sources = invoker.extra_sources 49 } 50 51 taihe_shared_library(target_name) { 52 forward_variables_from(invoker, 53 "*", 54 [ 55 "target_name", 56 "extra_sources", 57 ]) 58 59 taihe_generated_file_path = "$taihe_generated_file_path" 60 subsystem_name = "$subsystem_name" 61 part_name = "$part_name" 62 63 include_dirs = [ 64 "include", 65 "${image_subsystem}/interfaces/innerkits/include", 66 "${image_subsystem}/interfaces/kits/native/include/image", 67 "${image_subsystem}/plugins/common/libs/image/libextplugin/include/jpeg_yuv_decoder", 68 ] 69 70 sources = get_target_outputs(":run_taihe") 71 sources += [ 72 "${image_subsystem}/frameworks/innerkitsimpl/accessor/src/exif_metadata_formatter.cpp", 73 "src/auxiliary_picture_taihe.cpp", 74 "src/image_creator_taihe.cpp", 75 "src/image_packer_taihe.cpp", 76 "src/image_receiver_taihe.cpp", 77 "src/image_source_taihe.cpp", 78 "src/image_taihe.cpp", 79 "src/image_taihe_utils.cpp", 80 "src/picture_taihe.cpp", 81 "src/pixel_map_taihe.cpp", 82 ] + extra_sources 83 84 deps = [ 85 ":run_taihe", 86 "${image_subsystem}/frameworks/innerkitsimpl/egl_image:egl_image", 87 "${image_subsystem}/frameworks/innerkitsimpl/utils:image_utils", 88 "${image_subsystem}/interfaces/innerkits:image_native", 89 ] 90 91 external_deps = [ 92 "c_utils:utils", 93 "eventhandler:libeventhandler", 94 "graphic_2d:EGL", 95 "graphic_2d:ani_color_space_object_convertor", 96 "graphic_2d:color_manager", 97 "graphic_2d:librender_service_base", 98 "graphic_2d:librender_service_client", 99 "graphic_surface:surface", 100 "graphic_surface:sync_fence", 101 "hilog:libhilog", 102 "hitrace:hitrace_meter", 103 "ipc:ipc_single", 104 "libjpeg-turbo:turbojpeg", 105 "runtime_core:ani_helpers", 106 ] 107 108 cflags = [ 109 "-DIMAGE_DEBUG_FLAG", 110 "-DIMAGE_COLORSPACE_FLAG", 111 ] 112 113 if (!use_clang_android && !use_clang_ios) { 114 branch_protector_ret = "pac_ret" 115 sanitize = { 116 cfi = true 117 cfi_cross_dso = true 118 cfi_vcall_icall_only = true 119 debug = false 120 } 121 } 122 } 123} 124 125image_taihe_shared_library("image_taihe_core") { 126 extra_sources = [ "src/ani_constructor.cpp" ] 127} 128 129# APIs exposed to external modules 130image_taihe_shared_library("image_taihe") { 131 extra_sources = [ "src/pixel_map_taihe_ani.cpp" ] 132 public_configs = [ ":image_taihe_config" ] 133} 134 135generate_static_abc("image_framework_taihe_abc") { 136 base_url = "$taihe_generated_file_path" 137 files = [ "$taihe_generated_file_path/@ohos.multimedia.image.ets" ] 138 is_boot_abc = "True" 139 device_dst_file = "/system/framework/image_framework_taihe_abc.abc" 140 dependencies = [ ":run_taihe" ] 141} 142 143ohos_prebuilt_etc("image_framework_etc") { 144 source = "$target_out_dir/image_framework_taihe_abc.abc" 145 module_install_dir = "framework" 146 part_name = "$part_name" 147 subsystem_name = "$subsystem_name" 148 deps = [ ":image_framework_taihe_abc" ] 149} 150 151group("image_framework_taihe") { 152 deps = [ 153 ":image_framework_etc", 154 ":image_taihe_core", 155 ] 156} 157 158group("image_framework_taihe_gen_only") { 159 deps = [ ":run_taihe" ] 160} 161