• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      "arkts_frontend:arkts_frontend_$platform",
38      "card_frontend:card_frontend_$platform",
39      "codec:data_codec",
40      "common:bridge_common_$platform",
41      "common/accessibility:bridge_accessibility_$platform",
42      "js_frontend:js_frontend_$platform",
43      "plugin_frontend:plugin_frontend_$platform",
44    ]
45
46    if (build_ohos_sdk || is_arkui_x) {
47      deps -= [ "arkts_frontend:arkts_frontend_$platform" ]
48    }
49
50    if (defined(config.js_pa_support) && config.js_pa_support) {
51      deps += [ "$ace_root/${config.pa_engine_path}:pa_backend_$platform" ]
52    }
53    if (use_hilog) {
54      external_deps = [ "hilog:libhilog" ]
55    }
56  }
57}
58
59# build ng framework bridge
60template("framework_bridge_ng") {
61  forward_variables_from(invoker, "*")
62
63  ohos_source_set(target_name) {
64    if (current_os == "ohos") {
65      sanitize = {
66        integer_overflow = true
67        boundary_sanitize = true
68        debug = ace_sanitize_debug
69      }
70    }
71    subsystem_name = ace_engine_subsystem
72    part_name = ace_engine_part
73    configs = [ "$ace_root:ace_config" ]
74
75    deps = [
76      "arkts_frontend:arkts_frontend_$platform",
77      "codec:data_codec",
78      "common:bridge_common_ng_$platform",
79      "common/accessibility:bridge_accessibility_$platform",
80      "declarative_frontend:declarative_frontend_$platform",
81    ]
82    if (is_arkui_x) {
83      deps -= [ "arkts_frontend:arkts_frontend_$platform" ]
84    }
85    if (defined(config.js_pa_support) && config.js_pa_support) {
86      deps += [ "$ace_root/${config.pa_engine_path}:pa_backend_$platform" ]
87    }
88    if (use_hilog) {
89      external_deps = [ "hilog:libhilog" ]
90    }
91  }
92}
93
94foreach(item, ace_platforms) {
95  framework_bridge("framework_bridge_" + item.name) {
96    platform = item.name
97    config = {
98    }
99
100    if (defined(item.config)) {
101      config = item.config
102    }
103  }
104
105  framework_bridge_ng("framework_bridge_ng_" + item.name) {
106    platform = item.name
107    config = {
108    }
109
110    if (defined(item.config)) {
111      config = item.config
112    }
113  }
114}
115