1# Copyright (c) 2021-2022 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 17# build framework bridge 18template("framework_bridge") { 19 forward_variables_from(invoker, "*") 20 21 ohos_source_set(target_name) { 22 if (current_os == "ohos") { 23 sanitize = { 24 integer_overflow = true 25 boundary_sanitize = true 26 debug = ace_sanitize_debug 27 } 28 } 29 subsystem_name = ace_engine_subsystem 30 part_name = ace_engine_part 31 configs = [ "$ace_root:ace_config" ] 32 33 deps = [ 34 "declarative_frontend:declarative_frontend_$platform", 35 36 # bridge source 37 "card_frontend:card_frontend_$platform", 38 "codec:data_codec", 39 "common:bridge_common_$platform", 40 "common/accessibility:bridge_accessibility_$platform", 41 "js_frontend:js_frontend_$platform", 42 "plugin_frontend:plugin_frontend_$platform", 43 ] 44 45 if (defined(config.js_pa_support) && config.js_pa_support) { 46 deps += [ "$ace_root/${config.pa_engine_path}:pa_backend_$platform" ] 47 } 48 } 49} 50 51# build ng framework bridge 52template("framework_bridge_ng") { 53 forward_variables_from(invoker, "*") 54 55 ohos_source_set(target_name) { 56 if (current_os == "ohos") { 57 sanitize = { 58 integer_overflow = true 59 boundary_sanitize = true 60 debug = ace_sanitize_debug 61 } 62 } 63 subsystem_name = ace_engine_subsystem 64 part_name = ace_engine_part 65 configs = [ "$ace_root:ace_config" ] 66 67 deps = [ 68 "codec:data_codec", 69 "common:bridge_common_ng_$platform", 70 "common/accessibility:bridge_accessibility_$platform", 71 "declarative_frontend:declarative_frontend_$platform", 72 ] 73 74 if (defined(config.js_pa_support) && config.js_pa_support) { 75 deps += [ "$ace_root/${config.pa_engine_path}:pa_backend_$platform" ] 76 } 77 } 78} 79 80foreach(item, ace_platforms) { 81 framework_bridge("framework_bridge_" + item.name) { 82 platform = item.name 83 config = { 84 } 85 86 if (defined(item.config)) { 87 config = item.config 88 } 89 } 90 91 framework_bridge_ng("framework_bridge_ng_" + item.name) { 92 platform = item.name 93 config = { 94 } 95 96 if (defined(item.config)) { 97 config = item.config 98 } 99 } 100} 101