• 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    deps = [ "$ace_root/frameworks/base:ace_base_$platform" ]
23
24    if (enable_ng_build) {
25      deps += [
26        "$ace_root/frameworks/bridge:framework_bridge_ng_$platform",
27        "$ace_root/frameworks/core:ace_core_ng_$platform",
28      ]
29    } else {
30      deps += [
31        "$ace_root/frameworks/bridge:framework_bridge_$platform",
32        "$ace_root/frameworks/core:ace_core_$platform",
33      ]
34    }
35
36    if (defined(config.platform_deps)) {
37      deps += config.platform_deps
38    }
39
40    # build-in ark js engine for preview
41    if (defined(config.use_build_in_js_engine) &&
42        config.use_build_in_js_engine && defined(config.ark_engine)) {
43      deps += [
44        "$ace_root/frameworks/bridge/declarative_frontend:declarative_js_engine_ark_$platform",
45        "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_ark_$platform",
46      ]
47    }
48    part_name = ace_engine_part
49    subsystem_name = ace_engine_subsystem
50  }
51}
52
53# build platform engine sources
54template("ace_bridge_engine") {
55  forward_variables_from(invoker, "*")
56
57  ohos_shared_library(target_name) {
58    configs = []
59    deps = []
60
61    assert(defined(platform) && platform == "ohos",
62           "Only ohos need separated engine lib")
63
64    if (build_type == "engine") {
65      if (use_js_debug) {
66        deps += [ "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_${engine_name}_debug_$platform" ]
67      } else {
68        deps += [ "$ace_root/frameworks/bridge/js_frontend/engine:js_engine_${engine_name}_$platform" ]
69      }
70    } else if (build_type == "engine_declarative") {
71      deps += [ "$ace_root/frameworks/bridge/declarative_frontend:declarative_js_engine_${engine_name}_$platform" ]
72    } else if (build_type == "engine_pa") {
73      deps += [ "$ace_root/${pa_engine_path}/engine:js_pa_engine_${engine_name}_$platform" ]
74    }
75
76    subsystem_name = ace_engine_subsystem
77    part_name = ace_engine_part
78  }
79}
80