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