1# Copyright (c) 2021-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 17# build static 18template("ace_ohos_standard_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 cflags_cc += invoker.cflags_cc 26 27 sources = [ 28 "$ace_root/adapter/ohos/entrance/ace_ability.cpp", 29 "$ace_root/adapter/ohos/entrance/ace_application_info.cpp", 30 "$ace_root/adapter/ohos/entrance/ace_container.cpp", 31 "$ace_root/adapter/ohos/entrance/ace_data_ability.cpp", 32 "$ace_root/adapter/ohos/entrance/ace_extra_input_data.cpp", 33 "$ace_root/adapter/ohos/entrance/ace_form_ability.cpp", 34 "$ace_root/adapter/ohos/entrance/ace_new_pipe_judgement.cpp", 35 "$ace_root/adapter/ohos/entrance/ace_service_ability.cpp", 36 "$ace_root/adapter/ohos/entrance/ace_translate_manager.cpp", 37 "$ace_root/adapter/ohos/entrance/ace_view_ohos.cpp", 38 "$ace_root/adapter/ohos/entrance/aps_monitor_impl.cpp", 39 "$ace_root/adapter/ohos/entrance/capability_registry.cpp", 40 "$ace_root/adapter/ohos/entrance/data_ability_helper_standard.cpp", 41 "$ace_root/adapter/ohos/entrance/dialog_container.cpp", 42 "$ace_root/adapter/ohos/entrance/event_pass_through_subscriber.cpp", 43 "$ace_root/adapter/ohos/entrance/file_asset_provider_impl.cpp", 44 "$ace_root/adapter/ohos/entrance/form_utils_impl.cpp", 45 "$ace_root/adapter/ohos/entrance/hap_asset_provider_impl.cpp", 46 "$ace_root/adapter/ohos/entrance/mmi_event_convertor.cpp", 47 "$ace_root/adapter/ohos/entrance/navigation_controller_helper.cpp", 48 "$ace_root/adapter/ohos/entrance/pa_container.cpp", 49 "$ace_root/adapter/ohos/entrance/plugin_utils_impl.cpp", 50 "$ace_root/adapter/ohos/entrance/subwindow/subwindow_ohos.cpp", 51 "$ace_root/adapter/ohos/entrance/touch_event_convertor.cpp", 52 "$ace_root/adapter/ohos/entrance/window/foldable_window_ohos.cpp", 53 "$ace_root/adapter/ohos/entrance/window_free_container.cpp", 54 55 # innerkits impl 56 "$ace_root/adapter/ohos/entrance/ui_content_impl.cpp", 57 "$ace_root/adapter/ohos/entrance/ui_event_impl.cpp", 58 "$ace_root/adapter/ohos/entrance/utils.cpp", 59 60 # drag window 61 "$ace_root/adapter/ohos/entrance/window/drag_window_ohos.cpp", 62 63 # ArkTs Card 64 "$ace_root/adapter/ohos/entrance/form_module_preloader.cpp", 65 66 # Dynamic Component 67 "$ace_root/adapter/ohos/entrance/dynamic_component/dynamic_component_renderer_impl.cpp", 68 "$ace_root/adapter/ohos/entrance/dynamic_component/uv_task_wrapper_impl.cpp", 69 70 #Miscdevice Vibrator 71 "$ace_root/adapter/ohos/entrance/vibrator/vibrator_utils.cpp", 72 73 # CJUtils 74 "$ace_root/adapter/ohos/entrance/cj_utils/cj_utils.cpp", 75 76 # AudioHaptic 77 "$ace_root/adapter/ohos/entrance/picker/picker_haptic_factory.cpp", 78 ] 79 80 if (enable_audio_framework && enable_player_framework) { 81 sources += [ 82 "$ace_root/adapter/ohos/entrance/picker/picker_haptic_controller.cpp", 83 "$ace_root/adapter/ohos/entrance/picker/picker_haptic_impl.cpp", 84 ] 85 } 86 87 if (target_cpu == "arm64") { 88 defines += [ "_ARM64_" ] 89 } 90 if (current_os == "ohos" && current_cpu == "x86_64") { 91 defines += [ "SIMULATOR_64" ] 92 } 93 94 configs = [ "$ace_root:ace_config" ] 95 96 include_dirs = [ 97 "$ace_root/interfaces/inner_api/ui_session", 98 "$ace_root", 99 ] 100 101 deps = [ 102 "$ace_root/adapter/ohos/capability:ace_capability_ohos", 103 "$ace_root/interfaces/inner_api/ace:ace_uicontent", 104 "$ace_root/interfaces/inner_api/ui_session:ui_session", 105 ] 106 107 external_deps = [ 108 "ability_base:base", 109 "ability_base:configuration", 110 "ability_base:extractortool", 111 "ability_base:view_data", 112 "ability_base:want", 113 "ability_runtime:ability_connect_callback_stub", 114 "ability_runtime:ability_context_native", 115 "ability_runtime:ability_manager", 116 "ability_runtime:abilitykit_native", 117 "ability_runtime:app_context", 118 "ability_runtime:auto_fill_manager", 119 "ability_runtime:data_ability_helper", 120 "ability_runtime:napi_common", 121 "ability_runtime:ui_extension", 122 "bundle_framework:appexecfwk_core", 123 "common_event_service:cesfwk_innerkits", 124 "data_share:datashare_consumer", 125 "ets_runtime:libark_jsruntime", 126 "eventhandler:libeventhandler", 127 "graphic_2d:2d_graphics", 128 "graphic_2d:librender_service_client", 129 "i18n:intl_util", 130 "input:libmmi-client", 131 "ipc:ipc_core", 132 "ipc:ipc_napi", 133 "miscdevice:vibrator_interface_native", 134 "napi:ace_napi", 135 "preferences:native_preferences", 136 "relational_store:native_dataability", 137 "relational_store:native_rdb", 138 "resource_management:global_resmgr", 139 "safwk:system_ability_fwk", 140 "samgr:samgr_proxy", 141 "window_manager:libdm", 142 "window_manager:libwm", 143 "window_manager:libwsutils", 144 "window_manager:scene_session", 145 "window_manager:screen_session_manager_client", 146 "zlib:shared_libz", 147 ] 148 defines += [ "INDEXER_SUPPORT_VIBRATOR" ] 149 if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { 150 external_deps += [ "graphic_2d:librender_service_base" ] 151 } 152 153 if (defined(global_parts_info) && 154 defined(global_parts_info.resourceschedule_resource_schedule_service)) { 155 external_deps += [ "resource_schedule_service:ressched_client" ] 156 defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 157 } 158 159 if (form_fwk_enable) { 160 external_deps += [ 161 "form_fwk:fmskit_native", 162 "form_fwk:fmskit_provider_client", 163 "form_fwk:form_manager", 164 ] 165 } 166 167 if (defined(config.media_library_exists) && config.media_library_exists) { 168 external_deps += [ "media_library:media_library_manager" ] 169 } 170 171 if (enable_audio_framework) { 172 external_deps += [ "audio_framework:audio_client" ] 173 } 174 175 if (enable_player_framework) { 176 external_deps += [ "player_framework:audio_haptic" ] 177 } 178 179 if (os_account_exists) { 180 external_deps += [ "os_account:os_account_innerkits" ] 181 } 182 deps += 183 [ "$ace_root/interfaces/inner_api/ui_service_manager:ui_service_mgr" ] 184 } 185} 186 187foreach(item, ace_platforms) { 188 platform = item.name 189 if (platform == "ohos" || platform == "ohos_ng") { 190 ace_ohos_standard_source_set("ace_ohos_standard_entrance_${platform}") { 191 defines = [] 192 cflags_cc = [] 193 config = { 194 } 195 196 if (defined(item.config)) { 197 config = item.config 198 } 199 200 if (defined(config.defines)) { 201 defines = config.defines 202 } 203 204 if (defined(config.cflags_cc)) { 205 cflags_cc = config.cflags_cc 206 } 207 } 208 } 209} 210