12b7e0694Sopenharmony_ci#Copyright (c) 2021 Huawei Device Co., Ltd.
22b7e0694Sopenharmony_ci#Licensed under the Apache License, Version 2.0 (the "License");
32b7e0694Sopenharmony_ci#you may not use this file except in compliance with the License.
42b7e0694Sopenharmony_ci#You may obtain a copy of the License at
52b7e0694Sopenharmony_ci#
62b7e0694Sopenharmony_ci#    http://www.apache.org/licenses/LICENSE-2.0
72b7e0694Sopenharmony_ci#
82b7e0694Sopenharmony_ci#Unless required by applicable law or agreed to in writing, software
92b7e0694Sopenharmony_ci#distributed under the License is distributed on an "AS IS" BASIS,
102b7e0694Sopenharmony_ci#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112b7e0694Sopenharmony_ci#See the License for the specific language governing permissions and
122b7e0694Sopenharmony_ci#limitations under the License.
132b7e0694Sopenharmony_ci
142b7e0694Sopenharmony_ciimport("//build/lite/config/component/lite_component.gni")
152b7e0694Sopenharmony_ciimport("//foundation/arkui/ace_engine_lite/ace_lite.gni")
162b7e0694Sopenharmony_ci
172b7e0694Sopenharmony_ciace_frameworks_root = "//foundation/arkui/ace_engine_lite/frameworks"
182b7e0694Sopenharmony_ciace_interface_root =
192b7e0694Sopenharmony_ci    "//foundation/arkui/ace_engine_lite/interfaces/inner_api/builtin"
202b7e0694Sopenharmony_ciace_target_root = "//foundation/arkui/ace_engine_lite/frameworks/targets"
212b7e0694Sopenharmony_ci
222b7e0694Sopenharmony_cilite_component("ace_module_manager_lite") {
232b7e0694Sopenharmony_ci  features = [ ":ace_module_manager" ]
242b7e0694Sopenharmony_ci}
252b7e0694Sopenharmony_ci
262b7e0694Sopenharmony_cilite_library("ace_module_manager") {
272b7e0694Sopenharmony_ci  if (ohos_kernel_type == "liteos_m") {
282b7e0694Sopenharmony_ci    target_type = "static_library"
292b7e0694Sopenharmony_ci  } else {
302b7e0694Sopenharmony_ci    target_type = "shared_library"
312b7e0694Sopenharmony_ci    cflags = [ "-Wall" ]
322b7e0694Sopenharmony_ci    cflags_cc = cflags
332b7e0694Sopenharmony_ci  }
342b7e0694Sopenharmony_ci
352b7e0694Sopenharmony_ci  include_dirs = [
362b7e0694Sopenharmony_ci    "$ace_frameworks_root/common/log",
372b7e0694Sopenharmony_ci    "$ace_frameworks_root/common/utils",
382b7e0694Sopenharmony_ci    "$ace_frameworks_root/include/base",
392b7e0694Sopenharmony_ci    "$ace_frameworks_root/native_engine/jsi",
402b7e0694Sopenharmony_ci    "$ace_interface_root/base",
412b7e0694Sopenharmony_ci    "$ace_interface_root/jsi",
422b7e0694Sopenharmony_ci    "//base/hiviewdfx/hilog_lite/interfaces/native/kits",
432b7e0694Sopenharmony_ci    "//third_party/jerryscript/jerry-core/include",
442b7e0694Sopenharmony_ci    "//third_party/bounds_checking_function/include",
452b7e0694Sopenharmony_ci  ]
462b7e0694Sopenharmony_ci  deps = [ "$ace_target_root" ]
472b7e0694Sopenharmony_ci
482b7e0694Sopenharmony_ci  sources = [ "$ace_frameworks_root/module_manager/module_manager.cpp" ]
492b7e0694Sopenharmony_ci
502b7e0694Sopenharmony_ci  public_deps = [
512b7e0694Sopenharmony_ci    "$ace_frameworks_root/common:ace_common_lite",
522b7e0694Sopenharmony_ci    "$ace_frameworks_root/native_engine:ace_native_engine_lite",
532b7e0694Sopenharmony_ci    "//commonlibrary/utils_lite/js/builtin:ace_utils_kits",
542b7e0694Sopenharmony_ci  ]
552b7e0694Sopenharmony_ci
562b7e0694Sopenharmony_ci  defines = ace_lite_common_defines
572b7e0694Sopenharmony_ci
582b7e0694Sopenharmony_ci  if (ohos_kernel_type == "liteos_m") {
592b7e0694Sopenharmony_ci    public_deps += [
602b7e0694Sopenharmony_ci      "//foundation/arkui/ui_lite:ui",
612b7e0694Sopenharmony_ci      "//third_party/bounds_checking_function:libsec_static",
622b7e0694Sopenharmony_ci      "//third_party/jerryscript:jerry_engine",
632b7e0694Sopenharmony_ci    ]
642b7e0694Sopenharmony_ci    if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
652b7e0694Sopenharmony_ci      public_deps -= [ "//commonlibrary/utils_lite/js/builtin:ace_utils_kits" ]
662b7e0694Sopenharmony_ci      cflags = [
672b7e0694Sopenharmony_ci        "--diag_suppress",
682b7e0694Sopenharmony_ci        "Pa137,Pe226",
692b7e0694Sopenharmony_ci      ]
702b7e0694Sopenharmony_ci      cflags_cc = cflags
712b7e0694Sopenharmony_ci    }
722b7e0694Sopenharmony_ci    if (defined(global_parts_info.security_huks)) {
732b7e0694Sopenharmony_ci      defines += [ "ENABLE_HUKS_ACE_LITE_FEATURE" ]
742b7e0694Sopenharmony_ci    }
752b7e0694Sopenharmony_ci  } else {
762b7e0694Sopenharmony_ci    public_deps += [
772b7e0694Sopenharmony_ci      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite/js/builtin:capability_api",
782b7e0694Sopenharmony_ci      "//base/hiviewdfx/hilog_lite/frameworks/js/builtin:ace_kit_hilog",
792b7e0694Sopenharmony_ci      "//base/security/huks/frameworks/crypto_lite/js/builtin:ace_kit_cipher",
802b7e0694Sopenharmony_ci      "//foundation/communication/netstack/frameworks/js/builtin:http_lite_shared",
812b7e0694Sopenharmony_ci      "//test/xts/device_attest_lite/interfaces/kit/js:kit_device_attest",
822b7e0694Sopenharmony_ci      "//third_party/bounds_checking_function:libsec_shared",
832b7e0694Sopenharmony_ci      "//third_party/jerryscript/jerry-core:jerry-core_shared",
842b7e0694Sopenharmony_ci    ]
852b7e0694Sopenharmony_ci
862b7e0694Sopenharmony_ci    if (ace_engine_lite_battery_lite_enable) {
872b7e0694Sopenharmony_ci      public_deps +=
882b7e0694Sopenharmony_ci          [ "//base/powermgr/battery_lite/frameworks/js:ace_battery_kits" ]
892b7e0694Sopenharmony_ci    }
902b7e0694Sopenharmony_ci
912b7e0694Sopenharmony_ci    if (ace_engine_lite_media_lite_enable) {
922b7e0694Sopenharmony_ci      public_deps += [ "//foundation/multimedia/media_lite/interfaces/kits/player_lite/js/builtin:audio_lite_api" ]
932b7e0694Sopenharmony_ci    }
942b7e0694Sopenharmony_ci  }
952b7e0694Sopenharmony_ci}
96