• 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
17template("napi_dragcontroller_static") {
18  forward_variables_from(invoker, "*")
19
20  ohos_source_set(target_name) {
21    defines += invoker.defines
22    defines += [ "USE_ARK_ENGINE" ]
23    cflags_cc += invoker.cflags_cc
24    configs = [ "$ace_root/interfaces/napi/kits:ace_napi_config" ]
25
26    sources = [ "js_drag_controller.cpp" ]
27    deps = [ "../utils:napi_utils_static_${platform}" ]
28    external_deps = []
29    if (defined(config.libace_target)) {
30      deps += [ config.libace_target ]
31    }
32
33    if (platform != "" && is_arkui_x) {
34      deps += [ "$crossplatform_plugin_root/libs/napi:napi_$platform" ]
35      defines += [ "CROSS_PLATFORM" ]
36      if (defined(config.enable_drag_framework) &&
37          config.enable_drag_framework) {
38        defines += [ "OHOS_BUILD_ENABLE_ARKUI_X" ]
39      }
40      if (target_os == "android") {
41        include_dirs = [ "$ace_root/adapter/android/entrance/java/jni" ]
42      } else if (target_os == "ios") {
43        include_dirs = [ "$ace_root/adapter/ios/entrance" ]
44      }
45      include_dirs += [
46        "$ace_graphic/rosen/modules",
47        "$ace_graphic/interfaces/inner_api/common",
48        "$ace_graphic/rosen/modules/platform/ipc_core",
49        "$ace_graphic/rosen/modules/2d_graphics/include",
50        "$ace_graphic/rosen/modules/2d_graphics/src",
51        "$ace_graphic/rosen/modules/2d_graphics/src/drawing/engine_adapter",
52        "$ace_graphic/rosen/modules/render_service_base/include",
53        "$ace_graphic/rosen/modules/render_service_client/core",
54        "$ace_graphic/frameworks/text/interface/export/rosen_text",
55        "$ace_graphic/interfaces/inner_api/composer",
56        "$ace_graphic/rosen/modules/composer/vsync/include",
57        "$ace_graphic/rosen/modules/platform",
58        "$ace_graphic/rosen/modules/platform/eventhandler",
59        "$ace_drag/interfaces/innerkits/interaction/include",
60        "$acd_input/interfaces/native/innerkits/event/include",
61        "$ace_graphic_surface/interfaces/inner_api/surface",
62        "$ace_graphic_surface/interfaces/inner_api/utils",
63      ]
64    } else {
65      external_deps += [
66        "ets_runtime:libark_jsruntime",
67        "napi:ace_napi",
68      ]
69    }
70    if (use_hilog) {
71      external_deps += [ "hilog:libhilog" ]
72    }
73    if (is_arkui_x) {
74      if (defined(config.pixel_map_support) && config.pixel_map_support) {
75        configs += [ "$crossplatform_multimedia_root/image_framework/interfaces/innerkits:image_external_config" ]
76      }
77    } else {
78      if (defined(config.pixel_map_support)) {
79        external_deps += [
80          "image_framework:image",
81          "image_framework:image_native",
82        ]
83      }
84    }
85
86    if (!is_arkui_x && defined(config.enable_drag_framework) &&
87        config.enable_drag_framework) {
88      external_deps += [
89        "device_status:devicestatus_client",
90        "graphic_2d:librender_service_base",
91        "graphic_2d:librender_service_client",
92      ]
93    }
94
95    if (defined(config.enable_drag_framework) && config.enable_drag_framework) {
96      if (defined(global_parts_info.distributeddatamgr_udmf)) {
97        external_deps += [ "udmf:udmf_client" ]
98        external_deps += [ "udmf:udmf_data_napi" ]
99        deps += [ "$ace_root/frameworks/core:ace_container_scope" ]
100      }
101      external_deps += [ "kv_store:distributeddata_inner" ]
102    }
103
104    subsystem_name = ace_engine_subsystem
105    part_name = ace_engine_part
106  }
107}
108
109foreach(item, ace_platforms) {
110  napi_dragcontroller_static("dragcontroller_static_" + item.name) {
111    defines = []
112    cflags_cc = []
113    config = {
114    }
115    platform = item.name
116
117    if (defined(item.config)) {
118      config = item.config
119    }
120
121    if (defined(config.defines)) {
122      defines = config.defines
123    }
124
125    if (defined(config.cflags_cc)) {
126      cflags_cc = config.cflags_cc
127    }
128  }
129}
130