• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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 libace static library
18template("libace_static") {
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
30    deps = [ "$ace_root/frameworks/base:ace_base_$platform" ]
31
32    if (enable_ng_build) {
33      deps += [
34        "$ace_root/frameworks/bridge:framework_bridge_ng_$platform",
35        "$ace_root/frameworks/core:ace_core_ng_$platform",
36      ]
37    } else {
38      deps += [
39        "$ace_root/frameworks/bridge:framework_bridge_$platform",
40        "$ace_root/frameworks/core:ace_core_$platform",
41      ]
42    }
43
44    if (defined(config.platform_deps)) {
45      deps += config.platform_deps
46    }
47
48    # build-in ark js engine for preview
49    if (defined(config.use_build_in_js_engine) &&
50        config.use_build_in_js_engine && defined(config.ark_engine)) {
51      if (enable_ng_build) {
52        deps += [ "$ace_root/frameworks/bridge/declarative_frontend:declarative_js_engine_ng_ark_$platform" ]
53      } else {
54        deps += [
55          "$ace_root/frameworks/bridge/declarative_frontend:declarative_js_engine_ark_$platform",
56          "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_ark_$platform",
57        ]
58      }
59    }
60    configs = [ "$ace_root:ace_coverage_config" ]
61    part_name = ace_engine_part
62    subsystem_name = ace_engine_subsystem
63  }
64}
65
66# build platform engine sources
67template("ace_bridge_engine") {
68  forward_variables_from(invoker, "*")
69
70  ohos_shared_library(target_name) {
71    configs = [ "$ace_root:ace_coverage_config" ]
72    deps = []
73
74    assert(defined(platform) && platform == "ohos",
75           "Only ohos need separated engine lib")
76
77    if (build_type == "engine") {
78      if (use_js_debug) {
79        deps += [ "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_${engine_name}_debug_$platform" ]
80      } else {
81        deps += [ "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_${engine_name}_$platform" ]
82      }
83    } else if (build_type == "engine_declarative") {
84      deps += [ "$ace_root/frameworks/bridge/declarative_frontend:declarative_js_engine_${engine_name}_$platform" ]
85    } else if (build_type == "engine_pa") {
86      deps += [ "$ace_root/${pa_engine_path}/engine:js_pa_engine_${engine_name}_$platform" ]
87    }
88
89    subsystem_name = ace_engine_subsystem
90    part_name = ace_engine_part
91  }
92}
93