• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("utilsecurec_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    config = {
24    }
25    if (defined(current_platform.config)) {
26      config = current_platform.config
27    }
28    if (defined(config.defines)) {
29      defines += config.defines
30    }
31    if (platform == "windows") {
32      external_deps = [ "bounds_checking_function:libsec_shared" ]
33      cflags = [ "-Wno-inconsistent-dllimport" ]
34    }
35  }
36}
37
38ohos_source_set("preview_osal_source") {
39  subsystem_name = ace_engine_subsystem
40  part_name = ace_engine_part
41  if (defined(current_platform.name)) {
42    platform = current_platform.name
43    defines = []
44    config = {
45    }
46    if (defined(current_platform.config)) {
47      config = current_platform.config
48    }
49    if (defined(config.defines)) {
50      defines += config.defines
51    }
52
53    sources = [
54      "${ace_root}/adapter/ohos/osal/log_wrapper.cpp",
55      "ace_checker.cpp",
56      "ace_engine_ext.cpp",
57      "ace_trace.cpp",
58      "advance/ai_write_adapter.cpp",
59      "advance/data_detector_adapter.cpp",
60      "advance/data_detector_mgr.cpp",
61      "advance/image_analyzer_adapter_impl.cpp",
62      "advance/image_analyzer_manager.cpp",
63      "advance/image_analyzer_mgr.cpp",
64      "advance/text_share_adapter.cpp",
65      "advance/text_share_mgr.cpp",
66      "advance/text_translation_adapter.cpp",
67      "advance/text_translation_mgr.cpp",
68      "app_bar_helper_impl.cpp",
69      "display_info_utils.cpp",
70      "download_manager_preview.cpp",
71      "drawing_color_filter_preview.cpp",
72      "drawing_lattice_preview.cpp",
73      "dynamic_module_helper.cpp",
74      "event_report.cpp",
75      "exception_handler.cpp",
76      "fetch_manager.cpp",
77      "file_uri_helper_preview.cpp",
78      "frame_report.cpp",
79      "image_packer_preview.cpp",
80      "image_source_preview.cpp",
81      "input_manager.cpp",
82      "input_method_manager_preview.cpp",
83      "modal_ui_extension_impl.cpp",
84      "mouse_style_ohos.cpp",
85      "package_event_proxy_preview.cpp",
86      "perf_interfaces.cpp",
87      "pixel_map_preview.cpp",
88      "response_data.cpp",
89      "ressched_report.cpp",
90      "socperf_client_impl.cpp",
91      "stage_card_parser.cpp",
92      "statusbar_event_proxy_preview.cpp",
93      "stylus_detector_default.cpp",
94      "stylus_detector_loader.cpp",
95      "stylus_detector_mgr.cpp",
96      "system_bar_style_ohos.cpp",
97      "system_properties.cpp",
98      "task/task_runner_adapter_impl.cpp",
99      "thread_priority.cpp",
100      "time_event_proxy_preview.cpp",
101      "trace_id_impl.cpp",
102      "view_data_wrap_impl.cpp",
103      "want_wrap_preview.cpp",
104      "websocket_manager.cpp",
105    ]
106
107    if (defined(resourceschedule_ffrt_support) &&
108        resourceschedule_ffrt_support) {
109      sources += [ "long_frame_report_impl.cpp" ]
110    }
111
112    cflags_cc = [
113      "-DNAME_MAX=128",
114      "-Wno-inconsistent-dllimport",
115    ]
116
117    deps = [
118      ":utilsecurec_source",
119      "//foundation/graphic/graphic_2d/rosen/modules/platform:image_native",
120    ]
121
122    external_deps = [
123      "curl:curl_shared",
124      "hilog:libhilog",
125      "window_manager:previewer_window",
126    ]
127
128    if (ace_use_rosen_drawing) {
129      external_deps += [
130        "graphic_2d:2d_graphics",
131        "graphic_2d:drawing_napi_impl",
132      ]
133    }
134
135    configs = [ "$ace_root:ace_config" ]
136
137    if (is_ohos_standard_system) {
138      sources += [
139        "${ace_root}/adapter/ohos/osal/resource_theme_style.cpp",
140        "frame_trace_adapter_impl.cpp",
141        "resource_adapter_impl_standard.cpp",
142        "resource_convertor.cpp",
143      ]
144      defines += [ "OHOS_STANDARD_SYSTEM" ]
145      if (platform == "windows") {
146        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ]
147      } else if (platform == "mac") {
148        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ]
149      } else if (platform == "linux") {
150        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ]
151      }
152      external_deps += [ "napi:ace_napi" ]
153    } else {
154      sources += [
155        "frame_trace_adapter_impl.cpp",
156        "resource_adapter_impl.cpp",
157      ]
158      include_dirs += [ "//prebuilts/ace-toolkit/preview/rich/include/resmgr/resourcemanager/include" ]
159      if (platform == "windows") {
160        defines += [ "NOGDI" ]
161        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/windows/tv/libresourcemanager_win.lib" ]
162      } else if (platform == "mac") {
163        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/mac/tv/libresourcemanager_mac.dylib" ]
164      } else if (platform == "linux") {
165        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/linux/tv/libresourcemanager_linux.so" ]
166      }
167    }
168  }
169}
170