• 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_translation_adapter.cpp",
65      "advance/text_translation_mgr.cpp",
66      "app_bar_helper_impl.cpp",
67      "display_info_utils.cpp",
68      "download_manager_preview.cpp",
69      "drawing_color_filter_preview.cpp",
70      "drawing_lattice_preview.cpp",
71      "event_report.cpp",
72      "exception_handler.cpp",
73      "fetch_manager.cpp",
74      "file_uri_helper_preview.cpp",
75      "frame_report.cpp",
76      "image_packer_preview.cpp",
77      "image_source_preview.cpp",
78      "input_method_manager_preview.cpp",
79      "modal_ui_extension_impl.cpp",
80      "mouse_style_ohos.cpp",
81      "package_event_proxy_preview.cpp",
82      "pixel_map_preview.cpp",
83      "response_data.cpp",
84      "ressched_report.cpp",
85      "socperf_client_impl.cpp",
86      "stage_card_parser.cpp",
87      "statusbar_event_proxy_preview.cpp",
88      "stylus_detector_default.cpp",
89      "stylus_detector_loader.cpp",
90      "stylus_detector_mgr.cpp",
91      "system_bar_style_ohos.cpp",
92      "system_properties.cpp",
93      "task/task_runner_adapter_impl.cpp",
94      "thread_priority.cpp",
95      "time_event_proxy_preview.cpp",
96      "trace_id_impl.cpp",
97      "view_data_wrap_impl.cpp",
98      "want_wrap_preview.cpp",
99    ]
100
101    if (defined(resourceschedule_ffrt_support) &&
102        resourceschedule_ffrt_support) {
103      sources += [ "long_frame_report_impl.cpp" ]
104    }
105
106    cflags_cc = [
107      "-DNAME_MAX=128",
108      "-Wno-inconsistent-dllimport",
109    ]
110
111    deps = [
112      ":utilsecurec_source",
113      "//foundation/graphic/graphic_2d/rosen/modules/platform:image_native",
114    ]
115
116    external_deps = [
117      "curl:curl_shared",
118      "hilog:libhilog",
119      "window_manager:previewer_window",
120    ]
121
122    if (ace_use_rosen_drawing) {
123      external_deps += [
124        "graphic_2d:2d_graphics",
125        "graphic_2d:drawing_napi_impl",
126      ]
127    }
128
129    configs = [ "$ace_root:ace_config" ]
130
131    if (is_ohos_standard_system) {
132      sources += [
133        "${ace_root}/adapter/ohos/osal/resource_theme_style.cpp",
134        "frame_trace_adapter_impl.cpp",
135        "resource_adapter_impl_standard.cpp",
136        "resource_convertor.cpp",
137      ]
138      defines += [ "OHOS_STANDARD_SYSTEM" ]
139      if (platform == "windows") {
140        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ]
141      } else if (platform == "mac") {
142        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ]
143      } else if (platform == "linux") {
144        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ]
145      }
146      external_deps += [ "napi:ace_napi" ]
147    } else {
148      sources += [
149        "frame_trace_adapter_impl.cpp",
150        "resource_adapter_impl.cpp",
151      ]
152      include_dirs = [ "//prebuilts/ace-toolkit/preview/rich/include/resmgr/resourcemanager/include" ]
153      if (platform == "windows") {
154        defines += [ "NOGDI" ]
155        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/windows/tv/libresourcemanager_win.lib" ]
156      } else if (platform == "mac") {
157        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/mac/tv/libresourcemanager_mac.dylib" ]
158      } else if (platform == "linux") {
159        libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/linux/tv/libresourcemanager_linux.so" ]
160      }
161    }
162  }
163}
164