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
18config("container_scope_config") {
19  visibility = [ ":*" ]
20  include_dirs = [ "$ace_root/frameworks" ]
21}
22
23ohos_shared_library("ace_container_scope") {
24  public_configs = [ ":container_scope_config" ]
25
26  configs = [ "$ace_root:ace_config" ]
27
28  sources = [ "$ace_root/frameworks/core/common/container_scope.cpp" ]
29
30  subsystem_name = ace_engine_subsystem
31  innerapi_tags = [ "platformsdk_indirect" ]
32  part_name = ace_engine_part
33}
34
35ohos_static_library("ace_container_scope_static") {
36  public_configs = [ ":container_scope_config" ]
37
38  configs = [ "$ace_root:ace_config" ]
39
40  sources = [ "$ace_root/frameworks/core/common/container_scope.cpp" ]
41}
42
43# build core sources
44template("ace_core_source_set") {
45  forward_variables_from(invoker, "*")
46
47  ohos_source_set(target_name) {
48    if (current_os == "ohos") {
49      sanitize = {
50        integer_overflow = true
51        boundary_sanitize = true
52        debug = ace_sanitize_debug
53      }
54    }
55    subsystem_name = ace_engine_subsystem
56    part_name = ace_engine_part
57    defines += invoker.defines
58    platform = invoker.platform
59    include_dirs = []
60
61    if (ace_engine_feature_enable_split_mode &&
62        defined(vendor_configs.ace_engine_advanced_split_mode_dirs)) {
63      include_dirs += vendor_configs.ace_engine_advanced_split_mode_dirs
64    }
65
66    if (ace_engine_feature_enable_nav_split_mode &&
67        defined(
68            vendor_configs.ace_engine_advanced_navigation_split_mode_dirs)) {
69      include_dirs +=
70          vendor_configs.ace_engine_advanced_navigation_split_mode_dirs
71    }
72
73    # add common source file needed by all product platform here
74    sources = [
75      # accessibility
76      "accessibility/accessibility_manager_ng.cpp",
77      "accessibility/accessibility_node.cpp",
78      "accessibility/accessibility_session_adapter.cpp",
79      "accessibility/accessibility_utils.cpp",
80      "accessibility/native_interface_accessibility_impl.cpp",
81      "accessibility/native_interface_accessibility_provider.cpp",
82
83      # animation
84      "animation/animatable_data.cpp",
85      "animation/animatable_properties.cpp",
86      "animation/animation_util.cpp",
87      "animation/animator.cpp",
88      "animation/animator_group.cpp",
89      "animation/anticipate_curve.cpp",
90      "animation/bilateral_spring_adapter.cpp",
91      "animation/bilateral_spring_node.cpp",
92      "animation/card_transition_controller.cpp",
93      "animation/chain_animation.cpp",
94      "animation/cubic_curve.cpp",
95      "animation/curves.cpp",
96      "animation/friction_motion.cpp",
97      "animation/property_animation.cpp",
98      "animation/scheduler.cpp",
99      "animation/scroll_motion.cpp",
100      "animation/shared_transition_controller.cpp",
101      "animation/shared_transition_effect.cpp",
102      "animation/simple_spring_adapter.cpp",
103      "animation/simple_spring_chain.cpp",
104      "animation/simple_spring_node.cpp",
105      "animation/spring_animation.cpp",
106      "animation/spring_curve.cpp",
107      "animation/spring_model.cpp",
108      "animation/spring_motion.cpp",
109      "animation/svg_animate.cpp",
110
111      # common
112      "common/ace_application_info.cpp",
113      "common/ace_engine.cpp",
114      "common/ace_engine_ext.cpp",
115      "common/agingadapation/aging_adapation_dialog_util.cpp",
116      "common/anr_thread.cpp",
117      "common/asset_manager_impl.cpp",
118      "common/card_scope.cpp",
119      "common/clipboard/clipboard_proxy.cpp",
120      "common/container.cpp",
121      "common/container_scope.cpp",
122      "common/environment/environment_proxy.cpp",
123      "common/event_dump.cpp",
124      "common/event_manager.cpp",
125      "common/event_manager_pen.cpp",
126      "common/focus_animation_manager.cpp",
127      "common/font_loader.cpp",
128      "common/font_manager.cpp",
129      "common/frontend.cpp",
130      "common/platform_bridge.cpp",
131      "common/render_boundary_manager.cpp",
132      "common/resource/resource_manager.cpp",
133      "common/resource/resource_wrapper.cpp",
134      "common/sharedata/share_data.cpp",
135      "common/storage/storage_proxy.cpp",
136      "common/task_executor_impl.cpp",
137      "common/task_runner_adapter_factory.cpp",
138      "common/task_runner_adapter_impl.cpp",
139      "common/task_runners.cpp",
140      "common/text_field_manager.cpp",
141      "common/thread_checker.cpp",
142      "common/thread_container.cpp",
143      "common/thread_model_impl.cpp",
144      "common/vibrator/vibrator_proxy.cpp",
145      "common/watch_dog.cpp",
146      "common/window.cpp",
147
148      # declaration
149      "components/declaration/badge/badge_declaration.cpp",
150      "components/declaration/button/button_declaration.cpp",
151      "components/declaration/canvas/canvas_declaration.cpp",
152      "components/declaration/clock/clock_declaration.cpp",
153      "components/declaration/common/declaration.cpp",
154      "components/declaration/common/declaration_constants.cpp",
155      "components/declaration/common/declaration_creator_manager.cpp",
156      "components/declaration/common/event.cpp",
157      "components/declaration/div/div_declaration.cpp",
158      "components/declaration/image/image_animator_declaration.cpp",
159      "components/declaration/input/input_declaration.cpp",
160      "components/declaration/piece/piece_declaration.cpp",
161      "components/declaration/qrcode/qrcode_declaration.cpp",
162      "components/declaration/richtext/rich_text_declaration.cpp",
163      "components/declaration/search/search_declaration.cpp",
164      "components/declaration/side_bar/side_bar_declaration.cpp",
165      "components/declaration/span/span_declaration.cpp",
166      "components/declaration/svg/svg_animate_declaration.cpp",
167      "components/declaration/svg/svg_base_declaration.cpp",
168      "components/declaration/svg/svg_circle_declaration.cpp",
169      "components/declaration/svg/svg_declaration.cpp",
170      "components/declaration/svg/svg_ellipse_declaration.cpp",
171      "components/declaration/svg/svg_fe_blend_declaration.cpp",
172      "components/declaration/svg/svg_fe_colormatrix_declaration.cpp",
173      "components/declaration/svg/svg_fe_component_transfer_declaration.cpp",
174      "components/declaration/svg/svg_fe_composite_declaration.cpp",
175      "components/declaration/svg/svg_fe_declaration.cpp",
176      "components/declaration/svg/svg_fe_flood_declaration.cpp",
177      "components/declaration/svg/svg_fe_func_declaration.cpp",
178      "components/declaration/svg/svg_fe_gaussianblur_declaration.cpp",
179      "components/declaration/svg/svg_fe_merge_declaration.cpp",
180      "components/declaration/svg/svg_fe_merge_node_declaration.cpp",
181      "components/declaration/svg/svg_fe_offset_declaration.cpp",
182      "components/declaration/svg/svg_filter_declaration.cpp",
183      "components/declaration/svg/svg_gradient_declaration.cpp",
184      "components/declaration/svg/svg_image_declaration.cpp",
185      "components/declaration/svg/svg_line_declaration.cpp",
186      "components/declaration/svg/svg_mask_declaration.cpp",
187      "components/declaration/svg/svg_path_declaration.cpp",
188      "components/declaration/svg/svg_pattern_declaration.cpp",
189      "components/declaration/svg/svg_polygon_declaration.cpp",
190      "components/declaration/svg/svg_rect_declaration.cpp",
191      "components/declaration/svg/svg_stop_declaration.cpp",
192      "components/declaration/svg/svg_text_declaration.cpp",
193      "components/declaration/svg/svg_text_path_declaration.cpp",
194      "components/declaration/swiper/swiper_declaration.cpp",
195      "components/declaration/text/text_declaration.cpp",
196      "components/declaration/textarea/textarea_declaration.cpp",
197      "components/declaration/textfield/textfield_declaration.cpp",
198      "components/declaration/texttimer/texttimer_declaration.cpp",
199      "components/declaration/web/web_declaration.cpp",
200      "components/declaration/xcomponent/xcomponent_declaration.cpp",
201
202      # gestures
203      "gestures/click_recognizer.cpp",
204      "gestures/drag_event.cpp",
205      "gestures/drag_recognizer.cpp",
206      "gestures/exclusive_recognizer.cpp",
207      "gestures/gesture_recognizer.cpp",
208      "gestures/gesture_referee.cpp",
209      "gestures/long_press_recognizer.cpp",
210      "gestures/multi_fingers_recognizer.cpp",
211      "gestures/pan_recognizer.cpp",
212      "gestures/parallel_recognizer.cpp",
213      "gestures/pinch_recognizer.cpp",
214      "gestures/press_recognizer.cpp",
215      "gestures/raw_recognizer.cpp",
216      "gestures/rotation_recognizer.cpp",
217      "gestures/sequenced_recognizer.cpp",
218      "gestures/single_child_gesture.cpp",
219      "gestures/slide_recognizer.cpp",
220      "gestures/swipe_recognizer.cpp",
221      "gestures/timeout_recognizer.cpp",
222      "gestures/velocity_tracker.cpp",
223
224      # declarative
225      "gestures/gesture_group.cpp",
226      "gestures/long_press_gesture.cpp",
227      "gestures/pan_gesture.cpp",
228      "gestures/pinch_gesture.cpp",
229      "gestures/rotation_gesture.cpp",
230      "gestures/slide_gesture.cpp",
231      "gestures/tap_gesture.cpp",
232      "gestures/timeout_gesture.cpp",
233
234      # event
235      "event/back_end_event_manager.cpp",
236      "event/event_convertor.cpp",
237      "event/key_event.cpp",
238      "event/key_event_recognizer.cpp",
239      "event/mouse_event.cpp",
240      "event/mouse_raw_recognizer.cpp",
241      "event/touch_event.cpp",
242
243      # focus
244      "focus/focus_node.cpp",
245
246      # image
247      "image/animated_image_player.cpp",
248      "image/image_cache.cpp",
249      "image/image_compressor.cpp",
250      "image/image_file_cache.cpp",
251      "image/image_loader.cpp",
252      "image/image_object.cpp",
253      "image/image_object_animated.cpp",
254      "image/image_object_svg.cpp",
255      "image/image_provider.cpp",
256      "image/image_source_info.cpp",
257
258      # textfield
259      "common/ime/text_editing_value.cpp",
260      "common/ime/text_input_action.cpp",
261      "common/ime/text_input_client.cpp",
262      "common/ime/text_input_configuration.cpp",
263      "common/ime/text_input_connection.cpp",
264      "common/ime/text_input_formatter.cpp",
265      "common/ime/text_input_proxy.cpp",
266      "common/ime/text_input_type.cpp",
267
268      # recorder
269      "common/recorder/event_config.cpp",
270      "common/recorder/event_controller.cpp",
271      "common/recorder/event_recorder.cpp",
272      "common/recorder/exposure_processor.cpp",
273      "common/recorder/node_data_cache.cpp",
274
275      # text
276      "text/text_emoji_processor.cpp",
277    ]
278
279    if (platform == "ohos" || platform == "ohos_ng") {
280      sources -= [ "common/anr_thread.cpp" ]
281    }
282
283    # add sources needed by phone and TV. wearable like watch do not need them
284    if (!is_wearable_product) {
285      sources += [
286        "event/multimodal/multimodal_manager.cpp",
287        "event/multimodal/multimodal_scene.cpp",
288      ]
289    }
290
291    # add sources needed by phone, tv and wearable. previews do not need them
292    if (defined(config.connect_server_support) &&
293        config.connect_server_support) {
294      if (use_ios) {
295        include_dirs += [ "$ark_toolchain_path" ]
296      }
297      sources += [ "common/connect_server_manager.cpp" ]
298    }
299
300    if (defined(config.hdc_register_support) && config.hdc_register_support) {
301      sources += [ "common/hdc_register.cpp" ]
302    }
303
304    configs = [ "$ace_root:ace_config" ]
305
306    deps = [
307      "pipeline:ace_core_pipeline_$platform",
308      "pipeline_ng:ace_core_pipeline_ng_$platform",
309    ]
310
311    external_deps = []
312    if (use_hilog) {
313      external_deps += [ "hilog:libhilog" ]
314    }
315    if (defined(config.build_for_preview) && config.build_for_preview) {
316      sources -= [ "common/task_runner_adapter_impl.cpp" ]
317    }
318
319    deps += [
320      "$ace_root/frameworks/core/components/ability_component:ace_core_components_ability_$platform",
321      "$ace_root/frameworks/core/components/align:ace_core_components_align_$platform",
322      "$ace_root/frameworks/core/components/arc:ace_core_components_arc_$platform",
323      "$ace_root/frameworks/core/components/badge:ace_core_components_badge_$platform",
324      "$ace_root/frameworks/core/components/box:ace_core_components_box_$platform",
325      "$ace_root/frameworks/core/components/bubble:ace_core_components_bubble_$platform",
326      "$ace_root/frameworks/core/components/button:ace_core_components_button_$platform",
327      "$ace_root/frameworks/core/components/calendar:ace_core_components_calendar_$platform",
328      "$ace_root/frameworks/core/components/chart:ace_core_components_chart_$platform",
329      "$ace_root/frameworks/core/components/checkable:ace_core_components_checkable_$platform",
330      "$ace_root/frameworks/core/components/clip:ace_core_components_clip_$platform",
331      "$ace_root/frameworks/core/components/clock:ace_core_components_clock_$platform",
332      "$ace_root/frameworks/core/components/common:ace_core_components_common_$platform",
333      "$ace_root/frameworks/core/components/container_modal:ace_core_components_container_modal_$platform",
334      "$ace_root/frameworks/core/components/counter:ace_core_components_counter_$platform",
335      "$ace_root/frameworks/core/components/coverage:ace_core_components_coverage_$platform",
336      "$ace_root/frameworks/core/components/custom_dialog:ace_core_components_custom_dialog_$platform",
337      "$ace_root/frameworks/core/components/custom_paint:ace_core_components_custom_paint_$platform",
338      "$ace_root/frameworks/core/components/data_panel:ace_core_components_data_panel_$platform",
339      "$ace_root/frameworks/core/components/dialog:ace_core_components_dialog_$platform",
340      "$ace_root/frameworks/core/components/dialog_modal:ace_core_components_dialog_modal_$platform",
341      "$ace_root/frameworks/core/components/dialog_tween:ace_core_components_dialog_tween_$platform",
342      "$ace_root/frameworks/core/components/display:ace_core_components_display_$platform",
343      "$ace_root/frameworks/core/components/divider:ace_core_components_divider_$platform",
344      "$ace_root/frameworks/core/components/drag_bar:ace_core_components_drag_bar_$platform",
345      "$ace_root/frameworks/core/components/drop_filter:ace_core_components_drop_filter_$platform",
346      "$ace_root/frameworks/core/components/flex:ace_core_components_flex_$platform",
347      "$ace_root/frameworks/core/components/focus_animation:ace_core_components_focus_animation_$platform",
348      "$ace_root/frameworks/core/components/focus_collaboration:ace_core_components_focus_collaboration_$platform",
349      "$ace_root/frameworks/core/components/focusable:ace_core_components_focusable_$platform",
350      "$ace_root/frameworks/core/components/font:ace_core_components_font_$platform",
351      "$ace_root/frameworks/core/components/foreach:ace_core_components_foreach_$platform",
352      "$ace_root/frameworks/core/components/gesture_listener:ace_core_components_gesture_listener_$platform",
353      "$ace_root/frameworks/core/components/grid:ace_core_components_grid_$platform",
354      "$ace_root/frameworks/core/components/grid_layout:ace_core_components_grid_layout_$platform",
355      "$ace_root/frameworks/core/components/hyperlink:ace_core_components_hyperlink_$platform",
356      "$ace_root/frameworks/core/components/ifelse:ace_core_components_ifelse_$platform",
357      "$ace_root/frameworks/core/components/image:ace_core_components_image_$platform",
358      "$ace_root/frameworks/core/components/indexer:ace_core_components_indexer_$platform",
359      "$ace_root/frameworks/core/components/list:ace_core_components_list_$platform",
360      "$ace_root/frameworks/core/components/marquee:ace_core_components_marquee_$platform",
361      "$ace_root/frameworks/core/components/menu:ace_core_components_menu_$platform",
362      "$ace_root/frameworks/core/components/mouse_listener:ace_core_components_mouse_listener_$platform",
363      "$ace_root/frameworks/core/components/navigation_bar:ace_core_components_navigation_bar_$platform",
364      "$ace_root/frameworks/core/components/navigator:ace_core_components_navigator_$platform",
365      "$ace_root/frameworks/core/components/option:ace_core_components_option_$platform",
366      "$ace_root/frameworks/core/components/overlay:ace_core_components_overlay_$platform",
367      "$ace_root/frameworks/core/components/padding:ace_core_components_padding_$platform",
368      "$ace_root/frameworks/core/components/page:ace_core_components_page_$platform",
369      "$ace_root/frameworks/core/components/page_transition:ace_core_components_page_transition_$platform",
370      "$ace_root/frameworks/core/components/panel:ace_core_components_panel_$platform",
371      "$ace_root/frameworks/core/components/picker:ace_core_components_picker_$platform",
372      "$ace_root/frameworks/core/components/positioned:ace_core_components_positioned_$platform",
373      "$ace_root/frameworks/core/components/progress:ace_core_components_progress_$platform",
374      "$ace_root/frameworks/core/components/proxy:ace_core_components_proxy_$platform",
375      "$ace_root/frameworks/core/components/qrcode:ace_core_components_qrcode_$platform",
376      "$ace_root/frameworks/core/components/refresh:ace_core_components_refresh_$platform",
377      "$ace_root/frameworks/core/components/relative_container:ace_core_components_relative_container_$platform",
378      "$ace_root/frameworks/core/components/root:ace_core_components_root_$platform",
379      "$ace_root/frameworks/core/components/scoring:ace_core_components_scoring_$platform",
380      "$ace_root/frameworks/core/components/scroll:ace_core_components_scroll_$platform",
381      "$ace_root/frameworks/core/components/scroll_bar:ace_core_components_scroll_bar_$platform",
382      "$ace_root/frameworks/core/components/search:ace_core_components_search_$platform",
383      "$ace_root/frameworks/core/components/select_popup:ace_core_components_select_popup_$platform",
384      "$ace_root/frameworks/core/components/semi_modal:ace_core_components_semi_modal_$platform",
385      "$ace_root/frameworks/core/components/shadow:ace_core_components_shadow_$platform",
386      "$ace_root/frameworks/core/components/shape:ace_core_components_shape_$platform",
387      "$ace_root/frameworks/core/components/shared_transition:ace_core_components_shared_transition_$platform",
388      "$ace_root/frameworks/core/components/sheet:ace_core_components_sheet_$platform",
389      "$ace_root/frameworks/core/components/side_bar:ace_core_components_side_bar_$platform",
390      "$ace_root/frameworks/core/components/slider:ace_core_components_slider_$platform",
391      "$ace_root/frameworks/core/components/split_container:ace_core_components_split_container_$platform",
392      "$ace_root/frameworks/core/components/stack:ace_core_components_stack_$platform",
393      "$ace_root/frameworks/core/components/stage:ace_core_components_stage_$platform",
394      "$ace_root/frameworks/core/components/stepper:ace_core_components_stepper_$platform",
395      "$ace_root/frameworks/core/components/svg:ace_core_components_svg_$platform",
396      "$ace_root/frameworks/core/components/swiper:ace_core_components_swiper_$platform",
397      "$ace_root/frameworks/core/components/tab_bar:ace_core_components_tab_bar_$platform",
398      "$ace_root/frameworks/core/components/text:ace_core_components_text_$platform",
399      "$ace_root/frameworks/core/components/text_clock:ace_core_components_text_clock_$platform",
400      "$ace_root/frameworks/core/components/text_field:ace_core_components_text_field_$platform",
401      "$ace_root/frameworks/core/components/text_span:ace_core_components_text_span_$platform",
402      "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform",
403      "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform",
404      "$ace_root/frameworks/core/components/theme:ace_core_components_theme_$platform",
405      "$ace_root/frameworks/core/components/tip:ace_core_components_tip_$platform",
406      "$ace_root/frameworks/core/components/toast:ace_core_components_toast_$platform",
407      "$ace_root/frameworks/core/components/toggle:ace_core_components_toggle_$platform",
408      "$ace_root/frameworks/core/components/touch_listener:ace_core_components_touch_listener_$platform",
409      "$ace_root/frameworks/core/components/track:ace_core_components_track_$platform",
410      "$ace_root/frameworks/core/components/transform:ace_core_components_transform_$platform",
411      "$ace_root/frameworks/core/components/transition:ace_core_components_transition_$platform",
412      "$ace_root/frameworks/core/components/triangle:ace_core_components_triangle_$platform",
413      "$ace_root/frameworks/core/components/tween:ace_core_components_tween_$platform",
414      "$ace_root/frameworks/core/components/watch_slider:ace_core_components_watch_slider_$platform",
415      "$ace_root/frameworks/core/components/wrap:ace_core_components_wrap_$platform",
416    ]
417
418    deps += [
419      "$ace_root/frameworks/core/components_v2/common:ace_core_components_common_v2_$platform",
420      "$ace_root/frameworks/core/components_v2/foreach:ace_core_components_foreach_v2_$platform",
421      "$ace_root/frameworks/core/components_v2/grid:ace_core_components_grid_v2_$platform",
422      "$ace_root/frameworks/core/components_v2/grid_layout:ace_core_components_grid_layout_v2_$platform",
423      "$ace_root/frameworks/core/components_v2/indexer:ace_core_components_indexer_v2_$platform",
424      "$ace_root/frameworks/core/components_v2/inspector:ace_core_components_inspector_v2_$platform",
425      "$ace_root/frameworks/core/components_v2/list:ace_core_components_list_v2_$platform",
426      "$ace_root/frameworks/core/components_v2/pattern_lock:ace_core_components_pattern_lock_$platform",
427      "$ace_root/frameworks/core/components_v2/swiper:ace_core_components_swiper_v2_$platform",
428      "$ace_root/frameworks/core/components_v2/tabs:ace_core_components_tabs_v2_$platform",
429      "$ace_root/frameworks/core/components_v2/water_flow:ace_core_components_water_flow_v2_$platform",
430    ]
431
432    deps += [ "$ace_root/frameworks/core/components_part_upd/foreach:ace_core_components_foreach_part_upd_$platform" ]
433
434    deps += [
435      "$ace_root/frameworks/core/components_ng/animation:ace_core_components_animation_ng_$platform",
436      "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform",
437      "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform",
438      "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform",
439      "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform",
440      "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform",
441      "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform",
442      "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform",
443      "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform",
444      "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform",
445      "$ace_root/frameworks/core/components_ng/svg:ace_core_components_svg_ng_$platform",
446      "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform",
447    ]
448
449    deps += [
450      "$ace_root/frameworks/core/components_ng/pattern/patternlock:ace_core_components_patternlock_pattern_ng_$platform",
451      "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform",
452      "$ace_root/frameworks/core/components_ng/pattern/rich_editor:ace_core_components_rich_editor_pattern_ng_$platform",
453      "$ace_root/frameworks/core/components_ng/pattern/security_component:ace_core_components_security_component_pattern_ng_$platform",
454      "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform",
455    ]
456
457    if (defined(config.model_component_support) &&
458        config.model_component_support) {
459      deps += [ "$ace_root/frameworks/core/components_ng/pattern/model:ace_core_components_model_pattern_ng_$platform" ]
460    }
461
462    if (defined(config.enable_ability_component) &&
463        config.enable_ability_component) {
464      deps += [ "$ace_root/frameworks/core/components_ng/pattern/ability_component:ace_core_components_ability_component_pattern_ng_$platform" ]
465    }
466    if (defined(config.enable_image_compression) &&
467        config.enable_image_compression) {
468      external_deps += [ "opencl-headers:libcl" ]
469      defines += [ "ENABLE_OPENCL" ]
470    }
471
472    if (current_os == "mingw" || current_os == "mac") {
473      sources -= [ "common/watch_dog.cpp" ]
474      sources += [ "common/watch_dog_mingw.cpp" ]
475    }
476
477    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
478      sources += [
479        "animation/native_curve_helper.cpp",
480        "common/rosen/rosen_convert_helper.cpp",
481      ]
482      if (is_ohos) {
483        external_deps += [ "graphic_2d:libtexgine" ]
484        if (enable_graphic_text_gine) {
485          external_deps += [ "graphic_2d:rosen_text" ]
486        }
487        defines += [ "TEXGINE_SUPPORT_FOR_OHOS" ]
488      }
489      if (is_arkui_x) {
490        deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ]
491        include_dirs += [
492          "//foundation/graphic/graphic_2d/utils/color_manager/export",
493          "//foundation/multimedia/image_framework/interfaces/innerkits/include",
494        ]
495      } else {
496        if (ace_use_rosen_drawing) {
497          external_deps += [ "graphic_2d:2d_graphics" ]
498        }
499        external_deps += [ "graphic_2d:librender_service_client" ]
500      }
501    }
502
503    if (!use_mingw_win && !use_mac && !is_wearable_product &&
504        !is_ohos_standard_system && !use_linux) {
505      deps += [ "$ace_root/frameworks/core/components/rich_text:ace_core_components_rich_text_$platform" ]
506    }
507
508    if (defined(config.web_components_support) &&
509        config.web_components_support && !is_arkui_x) {
510      deps += [
511        "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_for_web_$platform",
512        "$ace_root/frameworks/core/components/web:ace_core_components_web_$platform",
513        "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform",
514      ]
515    } else {
516      deps += [ "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_$platform" ]
517    }
518
519    # xcomponent components supports phone, TV and wearable except PC Preview
520    if (defined(config.xcomponent_components_support) &&
521        config.xcomponent_components_support) {
522      deps += [ "$ace_root/frameworks/core/components/xcomponent:ace_core_components_xcomponent_$platform" ]
523      deps += [ "$ace_root/frameworks/core/components_ng/pattern/xcomponent:ace_core_components_xcomponent_pattern_ng_$platform" ]
524    }
525
526    if (defined(config.enable_ability_component) &&
527        config.enable_ability_component) {
528      deps += [ "$ace_root/frameworks/core/components_v2/ability_component:ace_core_components_ability_v2_$platform" ]
529    }
530
531    if (defined(config.apng_image_support) && config.apng_image_support) {
532      defines += [ "APNG_IMAGE_SUPPORT" ]
533      deps += [ "$ace_root/frameworks/core/image/apng:ace_core_apng_$platform" ]
534    }
535
536    if (defined(config.form_components_support) &&
537        config.form_components_support) {
538      if (!use_mingw_win && !use_mac && !use_linux) {
539        sources += [ "common/form_manager.cpp" ]
540        deps += [
541          "$ace_root/frameworks/core/components/form:ace_core_components_form_$platform",
542          "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform",
543        ]
544        external_deps += [
545          "ability_base:base",
546          "ability_base:want",
547          "form_fwk:form_manager",
548        ]
549      }
550    }
551
552    if (defined(config.remote_window_support) && config.remote_window_support) {
553      if (!use_mingw_win && !use_mac && !use_linux) {
554        deps += [
555          "$ace_root/frameworks/core/components/remote_window:ace_core_components_remote_window_$platform",
556          "$ace_root/frameworks/core/components_ng/pattern/remote_window:ace_core_components_remote_window_pattern_ng_$platform",
557        ]
558      }
559    }
560
561    if (defined(config.build_container_scope_lib) &&
562        config.build_container_scope_lib) {
563      sources -= [ "common/container_scope.cpp" ]
564      if (is_arkui_x) {
565        deps += [ ":ace_container_scope_static" ]
566      } else {
567        deps += [ ":ace_container_scope" ]
568      }
569    }
570
571    if (defined(config.plugin_components_support) &&
572        config.plugin_components_support) {
573      deps += [
574        "$ace_root/frameworks/core/components/plugin:ace_core_components_plugin_$platform",
575        "$ace_root/frameworks/core/components_ng/pattern/plugin:ace_core_components_plugin_pattern_ng_$platform",
576      ]
577      sources += [ "common/plugin_manager.cpp" ]
578      external_deps += [ "c_utils:utils" ]
579    }
580
581    if (defined(config.preview_support) && config.preview_support) {
582      deps += [ "$ace_root/frameworks/core/components_ng/pattern/preview_mock:ace_core_components_preview_mock_pattern_ng_$platform" ]
583    }
584
585    if (is_arkui_x) {
586      include_dirs += [
587        "//foundation/appframework/ability/ability_runtime/cross_platform/frameworks/native/base/event_handler/include",
588        "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/inner_api/error",
589        "//foundation/graphic/graphic_2d/utils/color_manager/export",
590        "//foundation/multimedia/image_framework/interfaces/innerkits/include",
591      ]
592    }
593    if (!is_wearable_product) {
594      deps += [
595        "$ace_root/frameworks/core/components/multimodal:ace_core_components_multimodal_$platform",
596        "$ace_root/frameworks/core/components/piece:ace_core_components_piece_$platform",
597        "$ace_root/frameworks/core/components/popup:ace_core_components_popup_$platform",
598        "$ace_root/frameworks/core/components/rating:ace_core_components_rating_$platform",
599        "$ace_root/frameworks/core/components/select:ace_core_components_select_$platform",
600        "$ace_root/frameworks/core/components/tool_bar:ace_core_components_tool_bar_$platform",
601      ]
602      if (enable_player_framework) {
603        deps += [ "$ace_root/frameworks/core/components/video:ace_core_components_video_$platform" ]
604        if (enable_camera_framework) {
605          deps += [ "$ace_root/frameworks/core/components/camera:ace_core_components_camera_$platform" ]
606        }
607      }
608    }
609
610    if ((current_os == "mingw" || current_os == "mac" ||
611         current_os == "linux") && defined(config.enable_rosen_backend) &&
612        config.enable_rosen_backend) {
613      sources += [
614        # rs impl
615        "common/rosen/rosen_asset_manager.cpp",
616        "common/rosen/rosen_window.cpp",
617      ]
618      include_dirs +=
619          [ "//foundation/window/window_manager/interfaces/innerkits/wm" ]
620      external_deps += [ "libuv:uv" ]
621    }
622
623    if (defined(config.window_scene_support) && config.window_scene_support) {
624      deps += [
625        "$ace_root/frameworks/core/components_ng/pattern/ui_extension:ace_core_components_ui_extension_pattern_ng_$platform",
626        "$ace_root/frameworks/core/components_ng/pattern/window_scene:ace_core_components_window_scene_$platform",
627      ]
628    }
629
630    if (defined(config.use_platform_font) && config.use_platform_font) {
631      defines += [ "USE_PLATFORM_FONT" ]
632      sources += [ "common/font/font_platform_proxy.cpp" ]
633    }
634
635    # arkoala C interface
636    deps += [ "$ace_root/frameworks/core/interfaces/native:ace_core_interfaces_native_node_$platform" ]
637
638    cflags_cc = []
639    cflags_cc += invoker.cflags_cc
640  }
641}
642
643# build ng core sources
644template("ace_core_ng_source_set") {
645  forward_variables_from(invoker, "*")
646
647  ohos_source_set(target_name) {
648    if (current_os == "ohos") {
649      sanitize = {
650        integer_overflow = true
651        boundary_sanitize = true
652        debug = ace_sanitize_debug
653      }
654    }
655    subsystem_name = ace_engine_subsystem
656    part_name = ace_engine_part
657    defines += invoker.defines
658    platform = invoker.platform
659
660    # add common source file needed by all product platform here
661    sources = [
662      # accessibility
663      "accessibility/accessibility_manager_ng.cpp",
664      "accessibility/accessibility_node.cpp",
665      "accessibility/accessibility_session_adapter.cpp",
666      "accessibility/accessibility_utils.cpp",
667      "accessibility/native_interface_accessibility_impl.cpp",
668      "accessibility/native_interface_accessibility_provider.cpp",
669
670      # animation
671      "animation/animatable_data.cpp",
672      "animation/animatable_properties.cpp",
673      "animation/animation_util.cpp",
674      "animation/animator.cpp",
675      "animation/animator_group.cpp",
676      "animation/anticipate_curve.cpp",
677      "animation/bilateral_spring_adapter.cpp",
678      "animation/bilateral_spring_node.cpp",
679      "animation/chain_animation.cpp",
680      "animation/cubic_curve.cpp",
681      "animation/curves.cpp",
682      "animation/friction_motion.cpp",
683      "animation/property_animation.cpp",
684      "animation/scheduler.cpp",
685      "animation/scroll_motion.cpp",
686      "animation/simple_spring_adapter.cpp",
687      "animation/simple_spring_chain.cpp",
688      "animation/simple_spring_node.cpp",
689      "animation/spring_animation.cpp",
690      "animation/spring_curve.cpp",
691      "animation/spring_model.cpp",
692      "animation/spring_motion.cpp",
693      "animation/svg_animate.cpp",
694
695      # common
696      "common/ace_application_info.cpp",
697      "common/ace_engine.cpp",
698      "common/ace_engine_ext.cpp",
699      "common/agingadapation/aging_adapation_dialog_util.cpp",
700      "common/anr_thread.cpp",
701      "common/asset_manager_impl.cpp",
702      "common/card_scope.cpp",
703      "common/clipboard/clipboard_proxy.cpp",
704      "common/container.cpp",
705      "common/container_scope.cpp",
706      "common/environment/environment_proxy.cpp",
707      "common/event_dump.cpp",
708      "common/event_manager.cpp",
709      "common/event_manager_pen.cpp",
710      "common/focus_animation_manager.cpp",
711      "common/font_loader.cpp",
712      "common/font_manager.cpp",
713      "common/frontend.cpp",
714      "common/platform_bridge.cpp",
715      "common/render_boundary_manager.cpp",
716      "common/resource/resource_manager.cpp",
717      "common/resource/resource_wrapper.cpp",
718      "common/sharedata/share_data.cpp",
719      "common/storage/storage_proxy.cpp",
720      "common/task_executor_impl.cpp",
721      "common/task_runner_adapter_factory.cpp",
722      "common/task_runner_adapter_impl.cpp",
723      "common/task_runners.cpp",
724      "common/text_field_manager.cpp",
725      "common/thread_checker.cpp",
726      "common/thread_container.cpp",
727      "common/thread_model_impl.cpp",
728      "common/vibrator/vibrator_proxy.cpp",
729      "common/watch_dog.cpp",
730      "common/window.cpp",
731
732      # event
733      "event/back_end_event_manager.cpp",
734      "event/event_convertor.cpp",
735      "event/key_event.cpp",
736      "event/key_event_recognizer.cpp",
737      "event/mouse_event.cpp",
738      "event/mouse_raw_recognizer.cpp",
739      "event/touch_event.cpp",
740
741      # gestures
742      "gestures/click_recognizer.cpp",
743      "gestures/drag_event.cpp",
744      "gestures/drag_recognizer.cpp",
745      "gestures/exclusive_recognizer.cpp",
746      "gestures/gesture_recognizer.cpp",
747      "gestures/gesture_referee.cpp",
748      "gestures/long_press_recognizer.cpp",
749      "gestures/multi_fingers_recognizer.cpp",
750      "gestures/pan_recognizer.cpp",
751      "gestures/parallel_recognizer.cpp",
752      "gestures/pinch_recognizer.cpp",
753      "gestures/press_recognizer.cpp",
754      "gestures/raw_recognizer.cpp",
755      "gestures/rotation_recognizer.cpp",
756      "gestures/sequenced_recognizer.cpp",
757      "gestures/single_child_gesture.cpp",
758      "gestures/slide_recognizer.cpp",
759      "gestures/swipe_recognizer.cpp",
760      "gestures/timeout_recognizer.cpp",
761      "gestures/velocity_tracker.cpp",
762
763      # declarative gestures
764      "gestures/gesture_group.cpp",
765      "gestures/long_press_gesture.cpp",
766      "gestures/pan_gesture.cpp",
767      "gestures/pinch_gesture.cpp",
768      "gestures/rotation_gesture.cpp",
769      "gestures/slide_gesture.cpp",
770      "gestures/tap_gesture.cpp",
771      "gestures/timeout_gesture.cpp",
772
773      # pipeline
774      "pipeline/base/constants.cpp",
775      "pipeline/base/element_register.cpp",
776      "pipeline/base/related_node.cpp",
777      "pipeline/pipeline_base.cpp",
778
779      # image
780      "image/animated_image_player.cpp",
781      "image/image_cache.cpp",
782      "image/image_compressor.cpp",
783      "image/image_file_cache.cpp",
784      "image/image_loader.cpp",
785      "image/image_object.cpp",
786      "image/image_object_animated.cpp",
787      "image/image_object_svg.cpp",
788      "image/image_provider.cpp",
789      "image/image_source_info.cpp",
790
791      # textfield
792      "common/ime/text_editing_value.cpp",
793      "common/ime/text_input_action.cpp",
794      "common/ime/text_input_client.cpp",
795      "common/ime/text_input_configuration.cpp",
796      "common/ime/text_input_connection.cpp",
797      "common/ime/text_input_formatter.cpp",
798      "common/ime/text_input_proxy.cpp",
799      "common/ime/text_input_type.cpp",
800
801      # properties
802      "components/common/painter/rosen_decoration_painter.cpp",
803      "components/common/properties/alignment.cpp",
804      "components/common/properties/border.cpp",
805      "components/common/properties/border_edge.cpp",
806      "components/common/properties/border_image.cpp",
807      "components/common/properties/clip_path.cpp",
808      "components/common/properties/color.cpp",
809      "components/common/properties/decoration.cpp",
810      "components/common/properties/motion_path_evaluator.cpp",
811      "components/common/properties/shadow.cpp",
812      "components/common/properties/shadow_config.cpp",
813      "components/common/properties/text_style.cpp",
814      "components/common/properties/text_style_parser.cpp",
815
816      # layout
817      "components/common/layout/grid_column_info.cpp",
818      "components/common/layout/grid_container_info.cpp",
819      "components/common/layout/grid_system_manager.cpp",
820      "components/common/layout/screen_system_manager.cpp",
821
822      # v1 deps
823      "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
824      "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp",
825      "components/common/painter/rosen_svg_painter.cpp",
826      "components/custom_paint/render_custom_paint_creator.cpp",
827      "components/custom_paint/render_offscreen_canvas_creator.cpp",
828      "components/custom_paint/rosen_render_custom_paint.cpp",
829      "components/dialog/dialog_theme.cpp",
830      "components/font/constants_converter.cpp",
831      "components/font/font_loader_creator.cpp",
832      "components/font/font_manager_creator.cpp",
833      "components/font/rosen_font_collection.cpp",
834      "components/font/rosen_font_loader.cpp",
835      "components/font/rosen_font_manager.cpp",
836      "components/panel/sliding_events.cpp",
837      "components/picker/picker_animation.cpp",
838      "components/picker/picker_data.cpp",
839      "components/picker/picker_theme.cpp",
840      "components/scroll/scrollable.cpp",
841      "components/theme/app_theme.cpp",
842      "components/theme/blur_style_theme.cpp",
843      "components/theme/icon_theme.cpp",
844      "components/theme/shadow_theme.cpp",
845      "components/theme/theme_attributes.cpp",
846      "components/theme/theme_constants.cpp",
847      "components/theme/theme_manager_impl.cpp",
848      "components/theme/theme_utils.cpp",
849      "components/video/resource/player.cpp",
850
851      # v2 inspector
852      "components_v2/grid/grid_event.cpp",
853      "components_v2/grid_layout/grid_container_utils.cpp",
854      "components_v2/inspector/inspector_constants.cpp",
855      "components_v2/inspector/utils.cpp",
856
857      #declaration
858      "components/declaration/common/declaration.cpp",
859
860      # recorder
861      "common/recorder/event_config.cpp",
862      "common/recorder/event_controller.cpp",
863      "common/recorder/event_recorder.cpp",
864      "common/recorder/exposure_processor.cpp",
865      "common/recorder/node_data_cache.cpp",
866
867      # text
868      "text/text_emoji_processor.cpp",
869    ]
870    include_dirs = []
871    if (is_arkui_x) {
872      include_dirs += [
873        "//foundation/appframework/ability/ability_runtime/cross_platform/frameworks/native/base/event_handler/include",
874        "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/inner_api/error",
875        "//foundation/graphic/graphic_2d/utils/color_manager/export",
876        "//foundation/multimedia/image_framework/interfaces/innerkits/include",
877      ]
878      sources -= [ "components/declaration/common/declaration.cpp" ]
879      sources += [
880        "animation/card_transition_controller.cpp",
881        "components/common/properties/animatable_path.cpp",
882        "components/common/properties/border_image_edge.cpp",
883        "components/common/properties/color_factory.cpp",
884        "components/common/properties/edge.cpp",
885        "components/common/properties/page_transition_option.cpp",
886        "components/common/properties/scroll_bar.cpp",
887        "components/custom_paint/rosen_render_offscreen_canvas.cpp",
888        "components/declaration/common/event.cpp",
889        "components/svg/svg_transform.cpp",
890        "components/video/resource/ext_surface.cpp",
891        "components/video/resource/ext_texture.cpp",
892        "components/video/resource/resource.cpp",
893      ]
894    }
895
896    if (platform == "ohos" || platform == "ohos_ng") {
897      sources -= [ "common/anr_thread.cpp" ]
898    }
899
900    configs = [ "$ace_root:ace_config" ]
901
902    deps = [
903      "$ace_root/frameworks/core/components/theme:build_theme_code",
904      "pipeline_ng:ace_core_pipeline_ng_$platform",
905    ]
906
907    if (defined(config.build_for_preview) && config.build_for_preview) {
908      sources -= [ "common/task_runner_adapter_impl.cpp" ]
909    }
910
911    external_deps = []
912    if (use_hilog) {
913      external_deps += [ "hilog:libhilog" ]
914    }
915    if (defined(config.remote_window_support) && config.remote_window_support) {
916      if (!use_mingw_win && !use_mac && !use_linux) {
917        deps += [ "$ace_root/frameworks/core/components_ng/pattern/remote_window:ace_core_components_remote_window_pattern_ng_$platform" ]
918      }
919    }
920
921    if (defined(config.build_container_scope_lib) &&
922        config.build_container_scope_lib) {
923      sources -= [ "common/container_scope.cpp" ]
924      if (is_arkui_x) {
925        deps += [ ":ace_container_scope_static" ]
926      } else {
927        deps += [ ":ace_container_scope" ]
928      }
929    }
930    deps += [
931      "$ace_root/frameworks/core/components_ng/animation:ace_core_components_animation_ng_$platform",
932      "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform",
933      "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform",
934      "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform",
935      "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform",
936      "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform",
937      "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform",
938      "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform",
939      "$ace_root/frameworks/core/components_ng/pattern/rich_editor:ace_core_components_rich_editor_pattern_ng_$platform",
940      "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform",
941      "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform",
942      "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform",
943      "$ace_root/frameworks/core/components_ng/svg:ace_core_components_svg_ng_$platform",
944      "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform",
945    ]
946    if (is_arkui_x) {
947      deps -= [ "$ace_root/frameworks/core/components_ng/svg:ace_core_components_svg_ng_$platform" ]
948    }
949
950    if (defined(config.use_components_lib) && config.use_components_lib) {
951      deps += [ "$ace_root/frameworks/core/components_ng/common_napi_utils:ace_core_components_common_napi_utils_$platform" ]
952    } else {
953      deps += [
954        "$ace_root/frameworks/core/components_ng/pattern/patternlock:ace_core_components_patternlock_pattern_ng_$platform",
955        "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform",
956      ]
957    }
958
959    if (defined(config.enable_ability_component) &&
960        config.enable_ability_component) {
961      deps += [ "$ace_root/frameworks/core/components_ng/pattern/ability_component:ace_core_components_ability_component_pattern_ng_$platform" ]
962    }
963    if (defined(config.web_components_support) &&
964        config.web_components_support) {
965      if (!is_arkui_x) {
966        deps += [ "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform" ]
967        sources += [
968          "components/web/resource/web_client_impl.cpp",
969          "components/web/resource/web_configuration_observer.cpp",
970          "components/web/resource/web_delegate.cpp",
971          "components/web/resource/web_javascript_execute_callback.cpp",
972          "components/web/resource/web_javascript_result_callback.cpp",
973          "components/web/resource/web_resource.cpp",
974          "components/web/web_component.cpp",
975        ]
976
977        external_deps += [
978          "ability_runtime:abilitykit_native",
979          "ability_runtime:app_context",
980          "ability_runtime:app_manager",
981          "c_utils:utils",
982          "init:libbegetutil",
983          "ipc:ipc_core",
984          "napi:ace_napi",
985          "webview:libnweb",
986          "window_manager:libwm",
987        ]
988      } else {
989        deps += [ "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform" ]
990      }
991    }
992
993    if (defined(config.form_components_support) &&
994        config.form_components_support) {
995      if (!use_mingw_win && !use_mac && !use_linux) {
996        deps += [ "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform" ]
997      }
998    }
999    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
1000      sources += [
1001        "animation/native_curve_helper.cpp",
1002        "common/rosen/rosen_convert_helper.cpp",
1003      ]
1004      if (is_ohos) {
1005        external_deps += [ "graphic_2d:libtexgine" ]
1006        if (enable_graphic_text_gine) {
1007          external_deps += [ "graphic_2d:rosen_text" ]
1008        }
1009        defines += [ "TEXGINE_SUPPORT_FOR_OHOS" ]
1010      }
1011      if (is_arkui_x) {
1012        deps += [
1013          "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics:2d_graphics_source_$platform",
1014          "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static",
1015        ]
1016      } else {
1017        external_deps += [ "graphic_2d:librender_service_client" ]
1018        if (ace_use_rosen_drawing) {
1019          external_deps += [ "graphic_2d:2d_graphics" ]
1020        }
1021      }
1022    }
1023    if (defined(config.window_scene_support) && config.window_scene_support) {
1024      deps += [
1025        "$ace_root/frameworks/core/components_ng/pattern/ui_extension:ace_core_components_ui_extension_pattern_ng_$platform",
1026        "$ace_root/frameworks/core/components_ng/pattern/window_scene:ace_core_components_window_scene_$platform",
1027      ]
1028    }
1029
1030    if (defined(config.xcomponent_components_support) &&
1031        config.xcomponent_components_support) {
1032      deps += [ "$ace_root/frameworks/core/components_ng/pattern/xcomponent:ace_core_components_xcomponent_pattern_ng_$platform" ]
1033    }
1034
1035    # add sources needed by phone, tv and wearable. previews do not need them
1036    if (defined(config.connect_server_support) &&
1037        config.connect_server_support) {
1038      if (use_ios) {
1039        include_dirs += [ "$ark_toolchain_path" ]
1040      }
1041      sources += [ "common/connect_server_manager.cpp" ]
1042    }
1043
1044    if (defined(config.hdc_register_support) && config.hdc_register_support) {
1045      sources += [ "common/hdc_register.cpp" ]
1046    }
1047
1048    if (defined(config.plugin_components_support) &&
1049        config.plugin_components_support) {
1050      deps += [ "$ace_root/frameworks/core/components_ng/pattern/plugin:ace_core_components_plugin_pattern_ng_$platform" ]
1051      sources += [ "common/plugin_manager.cpp" ]
1052      external_deps += [ "c_utils:utils" ]
1053    }
1054
1055    deps += [ "$ace_root/frameworks/core/components_ng/pattern/security_component:ace_core_components_security_component_pattern_ng_$platform" ]
1056
1057    if (defined(config.model_component_support) &&
1058        config.model_component_support) {
1059      deps += [ "$ace_root/frameworks/core/components_ng/pattern/model:ace_core_components_model_pattern_ng_$platform" ]
1060    }
1061
1062    if (defined(config.enable_image_compression) &&
1063        config.enable_image_compression) {
1064      external_deps += [ "opencl-headers:libcl" ]
1065      defines += [ "ENABLE_OPENCL" ]
1066    }
1067
1068    if (defined(config.use_platform_font) && config.use_platform_font) {
1069      defines += [ "USE_PLATFORM_FONT" ]
1070      sources += [ "common/font/font_platform_proxy.cpp" ]
1071    }
1072
1073    cflags_cc = []
1074    cflags_cc += invoker.cflags_cc
1075  }
1076}
1077
1078foreach(item, ace_platforms) {
1079  ace_core_source_set("ace_core_" + item.name) {
1080    platform = item.name
1081
1082    if (defined(item.config)) {
1083      config = item.config
1084    } else {
1085      config = {
1086      }
1087    }
1088
1089    if (defined(config.defines)) {
1090      defines = config.defines
1091    } else {
1092      defines = []
1093    }
1094
1095    if (defined(config.cflags_cc)) {
1096      cflags_cc = config.cflags_cc
1097    } else {
1098      cflags_cc = []
1099    }
1100  }
1101
1102  ace_core_ng_source_set("ace_core_ng_" + item.name) {
1103    platform = item.name
1104
1105    if (defined(item.config)) {
1106      config = item.config
1107    } else {
1108      config = {
1109      }
1110    }
1111
1112    if (defined(config.defines)) {
1113      defines = config.defines
1114    } else {
1115      defines = []
1116    }
1117
1118    if (defined(config.cflags_cc)) {
1119      cflags_cc = config.cflags_cc
1120    } else {
1121      cflags_cc = []
1122    }
1123  }
1124}
1125