1# Copyright (c) 2024 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("//commonlibrary/ets_utils/ets_utils_config.gni")
16
17collections_sources = [ "native_module_collections.cpp" ]
18
19ohos_shared_library("collections") {
20  branch_protector_ret = "pac_ret"
21  sanitize = {
22    cfi = true
23    cfi_cross_dso = true
24    debug = false
25  }
26  deps = [ ":collections_static" ]
27  external_deps = [ "hilog:libhilog" ]
28  subsystem_name = "commonlibrary"
29  part_name = "ets_utils"
30  relative_install_dir = "module/arkts"
31}
32
33ohos_source_set("collections_static") {
34  branch_protector_ret = "pac_ret"
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39  }
40  include_dirs = [
41    "include",
42    ets_util_path,
43  ]
44  configs = []
45  sources = collections_sources
46
47  deps = []
48
49  if (is_arkui_x) {
50    include_dirs += [
51      "$plugins_root/hilog/include",
52      "$plugins_root/interfaces",
53      "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
54    ]
55
56    if (target_os == "android") {
57      defines = [ "ANDROID_PLATFORM" ]
58    } else if (target_os == "ios") {
59      defines = [ "IOS_PLATFORM" ]
60    }
61    deps += [
62      "$plugins_root/libs/icu:icu_${target_os}",
63      "$plugins_root/libs/napi:napi_${target_os}",
64      "$plugins_root/libs/securec:sec_${target_os}",
65    ]
66  } else {
67    external_deps = [
68      "bounds_checking_function:libsec_shared",
69      "hilog:libhilog",
70      "napi:ace_napi",
71    ]
72  }
73  subsystem_name = "commonlibrary"
74  part_name = "ets_utils"
75}
76
77group("collections_packages") {
78  public_deps = [ ":collections" ]
79}
80