1# Copyright (c) 2021-2024 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") 16import("//foundation/arkui/ace_engine/build/ace_ext.gni") 17 18# build static 19template("ace_osal_ohos_source_set") { 20 forward_variables_from(invoker, "*") 21 22 ohos_source_set(target_name) { 23 subsystem_name = ace_engine_subsystem 24 part_name = ace_engine_part 25 defines += invoker.defines 26 if (defined(vendor_configs.use_ext_surface) && 27 vendor_configs.use_ext_surface) { 28 defines += [ "EXT_SURFACE_ENABLE" ] 29 } 30 if (ace_engine_feature_enable_upgrade_skia) { 31 defines += [ "USE_NEW_SKIA" ] 32 } 33 if (is_ohos_standard_system) { 34 external_deps = [ 35 "hilog:libhilog", 36 "hitrace:hitrace_meter", 37 "init:libbeget_proxy", 38 "init:libbegetutil", 39 ] 40 if (defined(config.enable_standard_input) && 41 config.enable_standard_input) { 42 external_deps += [ "imf:inputmethod_client" ] 43 } 44 configs = [ "$ace_root:ace_config" ] 45 } else { 46 external_deps = [ 47 "hilog:libhilog", 48 "hitrace:hitrace_meter", 49 "init:libbegetutil", 50 ] 51 52 configs = [ "$ace_root:ace_config" ] 53 } 54 55 sources = [ 56 "ace_checker.cpp", 57 "ace_engine_ext.cpp", 58 "ace_trace.cpp", 59 "ai_write_adapter.cpp", 60 "anr_thread.cpp", 61 "app_bar_helper_impl.cpp", 62 "cpu_boost.cpp", 63 "data_detector_adapter.cpp", 64 "data_detector_loader.cpp", 65 "data_detector_mgr.cpp", 66 "data_url_analyzer_loader.cpp", 67 "data_url_analyzer_mgr.cpp", 68 "display_info_utils.cpp", 69 "download_manager_ohos.cpp", 70 "drawable_descriptor_ohos.cpp", 71 "event_report.cpp", 72 "exception_handler.cpp", 73 "feature_param.cpp", 74 "frame_report.cpp", 75 "image_analyzer_adapter_impl.cpp", 76 "image_analyzer_loader.cpp", 77 "image_analyzer_manager.cpp", 78 "image_analyzer_mgr.cpp", 79 "image_perf_ohos.cpp", 80 "input_method_manager_ohos.cpp", 81 "layout_inspector.cpp", 82 "log_wrapper.cpp", 83 "modal_ui_extension_impl.cpp", 84 "perf_interfaces.cpp", 85 "ressched_report.cpp", 86 "socperf_client_impl.cpp", 87 "stylus_detector_callback.cpp", 88 "stylus_detector_default.cpp", 89 "stylus_detector_loader.cpp", 90 "stylus_detector_mgr.cpp", 91 "system_properties.cpp", 92 "system_properties_multi_thread.cpp", 93 "text_share_adapter.cpp", 94 "text_share_loader.cpp", 95 "text_share_mgr.cpp", 96 "text_translation_adapter.cpp", 97 "text_translation_loader.cpp", 98 "text_translation_mgr.cpp", 99 "thp_extra_manager_impl.cpp", 100 "thread_priority.cpp", 101 "trace_id_impl.cpp", 102 "view_data_wrap_ohos.cpp", 103 "want_wrap_ohos.cpp", 104 "websocket_manager.cpp", 105 "window_utils.cpp", 106 ] 107 108 external_deps += [ 109 "ability_runtime:app_manager", 110 "hicollie:libhicollie", 111 "hiview:libperfmonitor", 112 "i18n:intl_util", 113 "init:libbegetutil", 114 ] 115 116 if (is_ohos_standard_system) { 117 sources += [ 118 "resource_adapter_impl.cpp", 119 "resource_adapter_impl_v2.cpp", 120 "resource_convertor.cpp", 121 "resource_theme_style.cpp", 122 ] 123 124 if (ohos_indep_compiler_enable) { 125 include_dirs = indep_compile_includes 126 } 127 128 deps = [] 129 130 if (defined(global_parts_info) && 131 defined(global_parts_info.resourceschedule_soc_perf)) { 132 external_deps += [ "soc_perf:socperf_client" ] 133 defines += [ "SOC_PERF_ENABLE" ] 134 } 135 136 if (defined(global_parts_info) && defined( 137 global_parts_info.resourceschedule_resource_schedule_service)) { 138 external_deps += [ "resource_schedule_service:ressched_client" ] 139 defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 140 } 141 142 if (defined(resourceschedule_ffrt_support) && 143 resourceschedule_ffrt_support) { 144 sources += [ "long_frame_report_impl.cpp" ] 145 external_deps += [ "ffrt:libffrt" ] 146 defines += [ "FFRT_CPUBOOST_EN" ] 147 } 148 149 external_deps += [ 150 "ability_base:view_data", 151 "ability_base:want", 152 "ability_runtime:abilitykit_native", 153 "graphic_2d:libframe_analyzer", 154 "image_framework:image", 155 "input:libmmi-client", 156 "napi:ace_napi", 157 "resource_management:global_resmgr", 158 ] 159 if (defined(config.accessibility_support) && 160 config.accessibility_support) { 161 sources += [ 162 "accessibility/accessibility_hidumper_osal.cpp", 163 "js_accessibility_manager.cpp", 164 "js_third_accessibility_hover_ng.cpp", 165 "js_third_provider_interaction_operation.cpp", 166 ] 167 deps += [ "$ace_root/frameworks/bridge/common/accessibility:bridge_accessibility_$platform" ] 168 external_deps += [ 169 "accessibility:accessibility_common", 170 "accessibility:accessibilityclient", 171 "accessibility:accessibilityconfig", 172 ] 173 } else { 174 sources += [ "fake_accessibility_manager.cpp" ] 175 } 176 if (frame_trace_support) { 177 sources += [ "frame_trace_adapter_impl.cpp" ] 178 external_deps += [ "frame_aware_sched:frame_trace_intf" ] 179 defines += [ "FRAME_TRACE_ENABLE" ] 180 } else { 181 sources += [ "frame_trace_adapter_fake_impl.cpp" ] 182 } 183 } else { 184 external_deps += [ "multimedia_image:image" ] 185 } 186 sources += [ 187 "background_task_helper_ohos.cpp", 188 "device_config.cpp", 189 "display_manager_ohos.cpp", 190 "drawing_color_filter_ohos.cpp", 191 "drawing_lattice_ohos.cpp", 192 "file_uri_helper_ohos.cpp", 193 "image_packer_ohos.cpp", 194 "image_source_ohos.cpp", 195 "input_manager.cpp", 196 "mouse_style_ohos.cpp", 197 "navigation_route_ohos.cpp", 198 "page_url_checker_ohos.cpp", 199 "page_viewport_config_ohos.cpp", 200 "pixel_map_ohos.cpp", 201 "system_bar_style_ohos.cpp", 202 ] 203 if (is_ohos_standard_system) { 204 cflags = [ "-DIMAGE_COLORSPACE_FLAG" ] 205 } 206 external_deps += [ 207 "ability_runtime:abilitykit_native", 208 "ability_runtime:app_manager", 209 "ability_runtime:connect_server_manager", 210 "ability_runtime:wantagent_innerkits", 211 "app_file_service:fileuri_native", 212 "background_task_mgr:bgtaskmgr_innerkits", 213 "bundle_framework:appexecfwk_core", 214 "graphic_2d:2d_graphics", 215 "graphic_2d:drawing_napi_impl", 216 "graphic_2d:librender_service_client", 217 "hicollie:libhicollie", 218 "hisysevent:libhisysevent", 219 "hitrace:libhitracechain", 220 "safwk:system_ability_fwk", 221 "samgr:samgr_proxy", 222 "window_manager:libdm", 223 "window_manager:libwm", 224 "window_manager:scene_session", 225 "window_manager:window_native_kit", 226 ] 227 228 if (defined(config.hichecker_exists) && config.hichecker_exists) { 229 external_deps += [ "hichecker:libhichecker" ] 230 } 231 deps += [ 232 "$ace_root/interfaces/inner_api/drawable_descriptor:drawable_descriptor", 233 ] 234 235 if (ability_runtime_graphics) { 236 external_deps += [ "image_framework:image_native" ] 237 } 238 } 239} 240 241foreach(item, ace_platforms) { 242 platform = item.name 243 if (platform == "ohos" || platform == "ohos_ng") { 244 ace_osal_ohos_source_set("ace_osal_ohos_${platform}") { 245 platform = item.name 246 assert(defined(platform) && platform != "", "platform must be defined") 247 defines = [] 248 config = { 249 } 250 251 if (defined(item.config)) { 252 config = item.config 253 } 254 if (defined(config.defines)) { 255 defines = config.defines 256 } 257 } 258 } 259} 260