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/lite/config/component/lite_component.gni")
15
16ace_common_root = "//foundation/arkui/ace_engine_lite/frameworks/common"
17ace_interface_root =
18    "//foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin"
19ace_target_root = "//foundation/arkui/ace_engine_lite/frameworks/targets"
20native_engine_root =
21    "//foundation/arkui/ace_engine_lite/frameworks/native_engine"
22
23lite_component("ace_native_engine_lite") {
24  features = [ ":ace_native_engine" ]
25}
26
27lite_library("ace_native_engine") {
28  if (ohos_kernel_type == "liteos_m") {
29    target_type = "static_library"
30    if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
31      cflags = [
32        "--diag_suppress",
33        "Pa137,Pe226",
34      ]
35      cflags_cc = cflags
36    }
37  } else {
38    target_type = "shared_library"
39  }
40
41  include_dirs = [
42    "$ace_common_root/log",
43    "$ace_common_root/memory",
44    "$ace_interface_root/async",
45    "$ace_interface_root/base",
46    "$ace_interface_root/jsi",
47    "//base/hiviewdfx/hilog_lite/interfaces/native/kits",
48    "//third_party/jerryscript/jerry-core/include",
49    "//foundation/arkui/ace_engine_lite/frameworks/include/base",
50    "//foundation/ability/ability_lite/interfaces/kits/ability_lite/slite",
51    "//foundation/ability/ability_lite/interfaces/kits/want_lite",
52    "//foundation/bundlemanager/bundle_framework_lite/interfaces/kits/bundle_lite",
53  ]
54
55  deps = [ "$ace_target_root" ]
56
57  sources = [
58    "$native_engine_root/async/js_async_work.cpp",
59    "$native_engine_root/async/message_queue_utils.cpp",
60    "$native_engine_root/jsi/jsi.cpp",
61  ]
62
63  public_deps = [ "$ace_common_root:ace_common_lite" ]
64
65  if (ohos_kernel_type == "liteos_m") {
66    public_deps += [
67      "//foundation/arkui/ui_lite:ui",
68      "//third_party/jerryscript:jerry_engine",
69    ]
70  } else {
71    public_deps += [ "//third_party/jerryscript/jerry-core:jerry-core_shared" ]
72  }
73}
74