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 sources = [ 33 "//third_party/bounds_checking_function/src/memset_s.c", 34 "//third_party/bounds_checking_function/src/securecutil.c", 35 "//third_party/bounds_checking_function/src/secureinput_w.c", 36 "//third_party/bounds_checking_function/src/secureprintoutput_a.c", 37 "//third_party/bounds_checking_function/src/secureprintoutput_w.c", 38 ] 39 cflags = [ "-Wno-inconsistent-dllimport" ] 40 } 41 configs = [ "//third_party/bounds_checking_function:libsec_public_config" ] 42 } 43} 44 45ohos_source_set("preview_osal_source") { 46 subsystem_name = ace_engine_subsystem 47 part_name = ace_engine_part 48 if (defined(current_platform.name)) { 49 platform = current_platform.name 50 defines = [] 51 config = { 52 } 53 if (defined(current_platform.config)) { 54 config = current_platform.config 55 } 56 if (defined(config.defines)) { 57 defines += config.defines 58 } 59 60 sources = [ 61 "${ace_root}/adapter/ohos/osal/log_wrapper.cpp", 62 "ace_checker.cpp", 63 "ace_engine_ext.cpp", 64 "ace_trace.cpp", 65 "app_bar_helper_impl.cpp", 66 "download_manager_preview.cpp", 67 "event_report.cpp", 68 "exception_handler.cpp", 69 "fetch_manager.cpp", 70 "file_uri_helper_preview.cpp", 71 "frame_report.cpp", 72 "image_source_preview.cpp", 73 "modal_ui_extension_impl.cpp", 74 "mouse_style_ohos.cpp", 75 "pixel_map_preview.cpp", 76 "response_data.cpp", 77 "ressched_report.cpp", 78 "socperf_client_impl.cpp", 79 "stage_card_parser.cpp", 80 "system_properties.cpp", 81 "trace_id_impl.cpp", 82 ] 83 84 cflags_cc = [ 85 "-DNAME_MAX=128", 86 "-Wno-inconsistent-dllimport", 87 ] 88 89 deps = [ 90 ":utilsecurec_source", 91 "//foundation/graphic/graphic_2d/rosen/modules/platform:image_native", 92 "//third_party/curl:curl_shared", 93 ] 94 95 external_deps = [ "hilog:libhilog" ] 96 97 configs = [ 98 "$ace_root:ace_config", 99 "//third_party/curl:curl_config", 100 ] 101 102 include_dirs = [ "//commonlibrary/c_utils/base/include" ] 103 104 if (is_ohos_standard_system) { 105 sources += [ 106 "${ace_root}/adapter/ohos/osal/resource_theme_style.cpp", 107 "frame_trace_adapter_impl.cpp", 108 "resource_adapter_impl_standard.cpp", 109 "resource_convertor.cpp", 110 ] 111 defines += [ "OHOS_STANDARD_SYSTEM" ] 112 if (platform == "windows") { 113 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ] 114 } else if (platform == "mac") { 115 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ] 116 } else if (platform == "linux") { 117 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ] 118 } 119 } else { 120 sources += [ 121 "frame_trace_adapter_impl.cpp", 122 "resource_adapter_impl.cpp", 123 ] 124 include_dirs = [ "//prebuilts/ace-toolkit/preview/rich/include/resmgr/resourcemanager/include" ] 125 if (platform == "windows") { 126 defines += [ "NOGDI" ] 127 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/windows/tv/libresourcemanager_win.lib" ] 128 } else if (platform == "mac") { 129 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/mac/tv/libresourcemanager_mac.dylib" ] 130 } else if (platform == "linux") { 131 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/linux/tv/libresourcemanager_linux.so" ] 132 } 133 } 134 } 135} 136