1# Copyright (C) 2021 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
17ohos_shared_library("webpplugin") {
18  if (!use_clang_android && !use_clang_ios) {
19    sanitize = {
20      cfi = true
21      cfi_cross_dso = true
22      cfi_vcall_icall_only = true
23      debug = false
24    }
25  }
26  sources = [
27    "//foundation/multimedia/image_framework/plugins/common/libs/image/libwebpplugin/src/plugin_export.cpp",
28    "//foundation/multimedia/image_framework/plugins/common/libs/image/libwebpplugin/src/webp_decoder.cpp",
29    "//foundation/multimedia/image_framework/plugins/common/libs/image/libwebpplugin/src/webp_encoder.cpp",
30  ]
31
32  include_dirs = [
33    "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/utils/include",
34    "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/pixelconverter/include",
35    "//foundation/multimedia/image_framework/plugins/manager/include",
36    "//foundation/multimedia/image_framework/plugins/manager/include/image",
37    "//foundation/multimedia/image_framework/plugins/manager/include/pluginbase",
38    "//foundation/multimedia/image_framework/plugins/common/libs/image/libwebpplugin/include",
39    "//foundation/multimedia/image_framework/interfaces/innerkits/include",
40  ]
41  if (use_mingw_win) {
42    defines = image_decode_windows_defines
43    include_dirs +=
44        [ "//foundation/multimedia/image_framework/mock/native/include" ]
45
46    deps = [
47      "${asdk_dir}/static_library/${target_os}_${target_cpu}:libwebp-image_static",
48      "//foundation/multimedia/image_framework/mock/native:log_mock_static",
49    ]
50  } else {
51    defines = [ "DUAL_ADAPTER" ]
52    DUAL_ADAPTER = true
53
54    deps = [
55      "${image_subsystem}/frameworks/innerkitsimpl/utils:image_utils",
56      "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/pixelconverter:pixelconvertadapter",
57      "//foundation/multimedia/image_framework/interfaces/innerkits:image_native",
58      "//foundation/multimedia/image_framework/plugins/manager:pluginmanager",
59    ]
60
61    if (DUAL_ADAPTER) {
62    }
63
64    external_deps = [
65      "c_utils:utils",
66      "ffmpeg:libohosffmpeg",
67      "graphic_2d:color_manager",
68      "graphic_surface:surface",
69      "hilog:libhilog",
70      "skia:libwebp",
71      "skia:skia_canvaskit",
72    ]
73  }
74
75  cflags = [ "-DIMAGE_COLORSPACE_FLAG" ]
76
77  innerapi_tags = [ "platformsdk" ]
78  part_name = "image_framework"
79  subsystem_name = "multimedia"
80}
81
82ohos_prebuilt_etc("webppluginmetadata") {
83  source = "webpplugin.pluginmeta"
84  relative_install_dir = "multimediaplugin/image"
85  subsystem_name = "multimedia"
86  part_name = "image_framework"
87}
88