1# Copyright (C) 2022-2023 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/multimedia/image_framework/ide/image_decode_config.gni") 16 17config("ffi_image_native_config") { 18 include_dirs = [ "include" ] 19 cflags_cc = [ "-std=c++17" ] 20} 21 22ohos_shared_library("cj_image_ffi") { 23 public_configs = [ ":ffi_image_native_config" ] 24 25 include_dirs = [ 26 "$image_subsystem/interfaces/innerkits/include", 27 "$image_subsystem/image_framework/frameworks/innerkitsimpl/utils/include", 28 ] 29 30 if (!use_clang_android && !use_clang_ios) { 31 sanitize = { 32 cfi = true 33 cfi_cross_dso = true 34 cfi_vcall_icall_only = true 35 debug = false 36 } 37 } 38 39 cflags = [ 40 "-DIMAGE_DEBUG_FLAG", 41 "-DIMAGE_COLORSPACE_FLAG", 42 ] 43 44 if (!defined(defines)) { 45 defines = [] 46 } 47 48 deps = [ 49 "$image_subsystem/frameworks/innerkitsimpl/egl_image:egl_image", 50 "$image_subsystem/frameworks/innerkitsimpl/pixelconverter:pixelconvertadapter", 51 "$image_subsystem/frameworks/innerkitsimpl/utils:image_utils", 52 "$image_subsystem/interfaces/innerkits:image_native", 53 "$image_subsystem/interfaces/kits/js/common:image", 54 ] 55 external_deps = [ 56 "c_utils:utils", 57 "graphic_2d:cj_color_manager_ffi", 58 "graphic_2d:EGL", 59 "graphic_2d:librender_service_base", 60 "graphic_2d:librender_service_client", 61 "graphic_surface:surface", 62 "graphic_surface:sync_fence", 63 "hilog:libhilog", 64 "ipc:cj_ipc_ffi", 65 "napi:ace_napi", 66 "napi:cj_bind_ffi", 67 "napi:cj_bind_native", 68 ] 69 sources = [ 70 "src/image_creator_impl.cpp", 71 "src/image_ffi.cpp", 72 "src/image_impl.cpp", 73 "src/image_packer_impl.cpp", 74 "src/image_pixel_map_ffi.cpp", 75 "src/image_receiver_impl.cpp", 76 "src/image_source_impl.cpp", 77 "src/metadata_impl.cpp", 78 "src/picture_impl.cpp", 79 "src/pixel_map_impl.cpp", 80 ] 81 82 if (is_ohos) { 83 defines += [ "OHOS_PLATFORM" ] 84 } 85 86 if (is_mingw) { 87 defines += [ "WINDOWS_PLATFORM" ] 88 } 89 90 innerapi_tags = [ "platformsdk" ] 91 92 subsystem_name = "multimedia" 93 part_name = "image_framework" 94} 95