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