• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/arkui/ace_engine/ace_config.gni")
16
17config("drawable_config") {
18  include_dirs = [
19    "${ace_root}",
20    "${ace_root}/frameworks",
21    "${ace_root}/interfaces/napi/kits/utils",
22    "${ace_root}/adapter/ohos/osal",
23    "${ace_root}/frameworks/core/components_ng/render",
24    "${ace_root}/interfaces/frameworks",
25    "${ace_root}/interfaces/inner_api/drawable_descriptor",
26    "${ace_root}/interfaces/napi/kits/drawabledescriptor",
27  ]
28  if (current_os != "ohos") {
29    include_dirs += [
30      "//base/global/resource_management/frameworks/resmgr/include",
31      "//base/global/resource_management/interfaces/inner_api/include",
32    ]
33  }
34}
35
36ohos_shared_library("drawable_descriptor") {
37  if (current_os == "ohos") {
38    sanitize = {
39      integer_overflow = true
40      boundary_sanitize = true
41      debug = ace_sanitize_debug
42    }
43  }
44  public_configs = [ ":drawable_config" ]
45
46  configs = [
47    "$ace_root:ace_config",
48    "$ace_root:ace_coverage_config",
49  ]
50
51  sources = [
52    "drawable_descriptor.cpp",
53    "image_converter.cpp",
54    "js_drawable_descriptor.cpp",
55  ]
56
57  deps = [ "$cjson_root:cjson" ]
58
59  if (ace_use_new_skia) {
60    deps += [ "$skia_root_new:skia_ohos" ]
61    defines = [ "NEW_SKIA" ]
62  } else {
63    deps += [ "$ace_flutter_engine_root/skia:ace_skia_ohos" ]
64  }
65
66  external_deps = [
67    "graphic_2d:librender_service_client",
68    "hilog:libhilog",
69    "napi:ace_napi",
70  ]
71
72  if (current_os == "ohos") {
73    external_deps += [
74      "graphic_2d:2d_graphics",
75      "image_framework:image",
76      "image_framework:image_native",
77      "resource_management:global_resmgr",
78    ]
79  } else {
80    defines += [ "PREVIEW" ]
81    external_deps += [ "hilog:libhilog" ]
82    if (use_mingw_win) {
83      defines += [ "WINDOWS_PLATFORM" ]
84      external_deps += [ "resource_management:win_resmgr" ]
85    }
86
87    if (use_mac) {
88      defines += [ "MAC_PLATFORM" ]
89      external_deps += [ "resource_management:mac_resmgr" ]
90    }
91
92    if (use_linux) {
93      defines += [ "LINUX_PLATFORM" ]
94      external_deps += [ "resource_management:linux_resmgr" ]
95    }
96  }
97
98  subsystem_name = ace_engine_subsystem
99  innerapi_tags = [ "platformsdk" ]
100  part_name = ace_engine_part
101}
102