1# Copyright (c) 2021-2022 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 17# build static 18template("ace_capability_ohos_source_set") { 19 forward_variables_from(invoker, "*") 20 21 ohos_source_set(target_name) { 22 subsystem_name = ace_engine_subsystem 23 part_name = ace_engine_part 24 defines += invoker.defines 25 26 configs = [ "$ace_root:ace_config" ] 27 28 sources = [ 29 "clipboard/clipboard_impl.cpp", 30 "environment/environment_impl.cpp", 31 "environment/environment_proxy_impl.cpp", 32 "preference/storage_impl.cpp", 33 ] 34 include_dirs = [] 35 external_deps = [ 36 "ability_base:want", 37 "ipc:ipc_core", 38 "preferences:native_preferences", 39 ] 40 if (defined(config.enable_system_clipboard) && 41 config.enable_system_clipboard) { 42 external_deps += [ "pasteboard:pasteboard_client" ] 43 defines += [ "SYSTEM_CLIPBOARD_SUPPORTED" ] 44 } 45 if (defined(config.enable_drag_framework) && config.enable_drag_framework) { 46 if (defined(global_parts_info.distributeddatamgr_udmf)) { 47 external_deps += [ "udmf:udmf_client" ] 48 external_deps += [ "udmf:udmf_data_napi" ] 49 sources += [ "udmf/udmf_impl.cpp" ] 50 } 51 external_deps += [ "kv_store:distributeddata_inner" ] 52 } 53 if (defined(config.enable_ability_component) && 54 config.enable_ability_component) { 55 if (os_account_exists) { 56 external_deps += [ "os_account:os_account_innerkits" ] 57 } 58 external_deps += [ 59 "ability_base:want", 60 "ability_runtime:ability_manager", 61 "ability_runtime:abilitykit_native", 62 "ability_runtime:runtime", 63 "bundle_framework:appexecfwk_base", 64 "c_utils:utils", 65 "eventhandler:libeventhandler", 66 "graphic_2d:librender_service_client", 67 "graphic_2d:surface", 68 "hilog:libhilog", 69 "input:libmmi-client", 70 "ipc:ipc_core", 71 "napi:ace_napi", 72 "window_manager:libwindow_extension_client", 73 "window_manager:scene_session", 74 ] 75 sources += [ 76 "window_connection/window_extension_connection_ohos.cpp", 77 "window_connection/window_extension_connection_proxy.cpp", 78 "window_connection_ng/window_extension_connection_ohos_ng.cpp", 79 "window_connection_ng/window_extension_connection_proxy_ng.cpp", 80 ] 81 } 82 } 83} 84 85foreach(item, ace_platforms) { 86 platform = item.name 87 if (platform == "ohos") { 88 ace_capability_ohos_source_set("ace_capability_ohos") { 89 defines = [] 90 config = { 91 } 92 93 if (defined(item.config)) { 94 config = item.config 95 } 96 if (defined(config.defines)) { 97 defines = config.defines 98 } 99 } 100 } 101} 102