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_engine_ext.cpp", 63 "ace_trace.cpp", 64 "event_report.cpp", 65 "exception_handler.cpp", 66 "fetch_manager.cpp", 67 "frame_report.cpp", 68 "mouse_style_ohos.cpp", 69 "pixel_map_preview.cpp", 70 "response_data.cpp", 71 "ressched_report.cpp", 72 "stage_card_parser.cpp", 73 "system_properties.cpp", 74 "trace_id_impl.cpp", 75 ] 76 77 cflags_cc = [ 78 "-DNAME_MAX=128", 79 "-Wno-inconsistent-dllimport", 80 ] 81 82 deps = [ 83 ":utilsecurec_source", 84 "//base/hiviewdfx/hilog/frameworks/libhilog:libhilog_source_$platform", 85 "//foundation/graphic/graphic_2d/rosen/modules/platform:image_native", 86 "//third_party/curl:curl_shared", 87 ] 88 89 configs = [ 90 "$ace_root:ace_config", 91 "//third_party/curl:curl_config", 92 ] 93 94 include_dirs = [ "//commonlibrary/c_utils/base/include" ] 95 96 if (is_standard_system) { 97 sources += [ 98 "${ace_root}/adapter/ohos/osal/resource_theme_style.cpp", 99 "frame_trace_adapter_impl.cpp", 100 "resource_adapter_impl_standard.cpp", 101 "resource_convertor.cpp", 102 ] 103 defines += [ "OHOS_STANDARD_SYSTEM" ] 104 if (platform == "windows") { 105 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ] 106 } else if (platform == "mac") { 107 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ] 108 } else if (platform == "linux") { 109 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ] 110 } 111 } else { 112 sources += [ 113 "frame_trace_adapter_impl.cpp", 114 "resource_adapter_impl.cpp", 115 ] 116 include_dirs = [ "//prebuilts/ace-toolkit/preview/rich/include/resmgr/resourcemanager/include" ] 117 if (platform == "windows") { 118 defines += [ "NOGDI" ] 119 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/windows/tv/libresourcemanager_win.lib" ] 120 } else if (platform == "mac") { 121 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/mac/tv/libresourcemanager_mac.dylib" ] 122 } else if (platform == "linux") { 123 libs = [ "//prebuilts/ace-toolkit/preview/rich/lib/linux/tv/libresourcemanager_linux.so" ] 124 } 125 } 126 } 127} 128