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