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 23 defines += [ "USE_ARK_ENGINE" ] 24 cflags_cc += invoker.cflags_cc 25 if (is_mac) { 26 cflags_cc += [ "-O0" ] 27 } 28 29 include_dirs = [ 30 "$ace_root", 31 "$ace_root/frameworks", 32 "$root_out_dir/arkui/framework", 33 "$ark_ets_path", 34 ] 35 36 sources = [ "js_drag_controller.cpp" ] 37 38 deps = [ "../utils:napi_utils_static_${platform}" ] 39 external_deps = [] 40 if (defined(config.libace_target)) { 41 deps += [ config.libace_target ] 42 } 43 44 if (platform != "" && is_arkui_x) { 45 deps += [ "$crossplatform_plugin_root/libs/napi:napi_$platform" ] 46 } else { 47 external_deps += [ 48 "ets_runtime:libark_jsruntime", 49 "napi:ace_napi", 50 ] 51 } 52 53 if (is_arkui_x) { 54 if (defined(config.pixel_map_support) && config.pixel_map_support) { 55 configs = [ "$crossplatform_multimedia_root/image_framework/interfaces/innerkits:image_external_config" ] 56 } 57 } else { 58 if (defined(config.pixel_map_support)) { 59 external_deps += [ 60 "image_framework:image", 61 "image_framework:image_native", 62 ] 63 } 64 } 65 66 if (!is_arkui_x && defined(config.enable_drag_framework) && 67 config.enable_drag_framework) { 68 external_deps += [ 69 "device_status:devicestatus_client", 70 "graphic_2d:librender_service_client", 71 ] 72 } 73 74 if (defined(config.enable_drag_framework) && config.enable_drag_framework) { 75 if (defined(global_parts_info.distributeddatamgr_udmf)) { 76 external_deps += [ "udmf:udmf_client" ] 77 external_deps += [ "udmf:udmf_data_napi" ] 78 } 79 external_deps += [ "kv_store:distributeddata_inner" ] 80 } 81 82 subsystem_name = ace_engine_subsystem 83 part_name = ace_engine_part 84 } 85} 86 87foreach(item, ace_platforms) { 88 napi_dragcontroller_static("dragcontroller_static_" + item.name) { 89 defines = [] 90 cflags_cc = [] 91 config = { 92 } 93 platform = item.name 94 95 if (defined(item.config)) { 96 config = item.config 97 } 98 99 if (defined(config.defines)) { 100 defines = config.defines 101 } 102 103 if (defined(config.cflags_cc)) { 104 cflags_cc = config.cflags_cc 105 } 106 } 107} 108