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
17ohos_source_set("preview_entrance_source") {
18  subsystem_name = ace_engine_subsystem
19  part_name = ace_engine_part
20  if (defined(current_platform.name)) {
21    platform = current_platform.name
22    defines = []
23    cflags_cc = []
24    config = {
25    }
26    if (defined(current_platform.config)) {
27      config = current_platform.config
28    }
29    if (defined(config.defines)) {
30      defines += config.defines
31    }
32    if (defined(config.cflags_cc)) {
33      cflags_cc += config.cflags_cc
34    }
35    configs = [ "$ace_root:ace_config" ]
36
37    # set icu_data_path for ark preview
38    defines += [ "INIT_ICU_DATA_PATH" ]
39
40    sources = [
41      "$ace_root/adapter/ohos/entrance/ace_new_pipe_judgement.cpp",
42      "ace_ability.cpp",
43      "ace_application_info.cpp",
44      "ace_container.cpp",
45      "ace_preview_helper.cpp",
46      "ace_resource_register.cpp",
47      "ace_view_preview.cpp",
48      "clipboard/clipboard_impl.cpp",
49      "clipboard/clipboard_proxy_impl.cpp",
50      "clipboard/multiType_record_impl.cpp",
51      "editing/text_input_client_mgr.cpp",
52      "editing/text_input_connection_impl.cpp",
53      "editing/text_input_impl.cpp",
54      "event_dispatcher.cpp",
55      "foldable_window_preview.cpp",
56      "html/html_to_span.cpp",
57      "html/span_to_html.cpp",
58      "msdp/interaction_impl.cpp",
59      "subwindow_preview.cpp",
60      "timepicker/timepicker_haptic_factory.cpp",
61      "touch_event_convertor.cpp",
62      "udmf/udmf_impl.cpp",
63      "ui_content_impl.cpp",
64      "vibrator/vibrator_utils.cpp",
65      "xcollie/xcollieInterface_impl.cpp",
66    ]
67
68    deps = [
69      "$ace_napi:ace_napi",
70      "$ace_root/frameworks/core/components/theme:build_theme_code",
71      "$ace_root/interfaces/inner_api/ace:ace_uicontent",
72    ]
73    external_deps = []
74    include_dirs = [
75      "//foundation/window/window_manager",
76      "//foundation/ability/ability_runtime",
77      "//arkcompiler/ets_runtime",
78      "//arkcompiler/runtime_core",
79    ]
80
81    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
82      external_deps += [
83        "graphic_2d:librender_service_client",
84        "window_manager:previewer_window",
85      ]
86      if (ace_use_rosen_drawing) {
87        external_deps += [ "graphic_2d:2d_graphics" ]
88      }
89    }
90
91    if (!is_arkui_x) {
92      if (platform == "windows") {
93        defines -= [ "UNICODE" ]
94        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ]
95        cflags_cc += [ "-DNONLS" ]
96      }
97
98      if (platform == "mac") {
99        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ]
100      }
101
102      if (platform == "linux") {
103        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ]
104      }
105    }
106  }
107}
108