1# Copyright (c) 2021-2022 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("//base/global/i18n/i18n.gni")
15import("//build/ohos.gni")
16
17group("build_module") {
18  deps = [
19    ":i18n",
20    ":intl",
21  ]
22}
23
24ohos_shared_library("intl") {
25  include_dirs = [
26    "//base/global/i18n/frameworks/intl/include",
27    "//base/global/i18n/interfaces/js/kits/include",
28  ]
29
30  sources = [ "src/intl_addon.cpp" ]
31
32  deps = [ "//base/global/i18n/frameworks/intl:intl_util" ]
33  external_deps = [
34    "hilog:libhilog",
35    "icu:shared_icuuc",
36    "libphonenumber:phonenumber_standard",
37    "napi:ace_napi",
38  ]
39  relative_install_dir = "module"
40  subsystem_name = "global"
41  part_name = "i18n"
42}
43
44ohos_shared_library("i18n") {
45  include_dirs = [
46    "//base/global/i18n/frameworks/intl/include",
47    "//base/global/i18n/interfaces/js/kits/include",
48    "//base/global/i18n/interfaces/native/inner_api/i18n/include",
49    "//base/global/i18n/services/include",
50  ]
51  cflags_cc = [ "-frtti" ]
52  remove_configs = [ "//build/config/compiler:no_rtti" ]
53  sources = [
54    "src/entity_recognizer_addon.cpp",
55    "src/error_util.cpp",
56    "src/holiday_manager_addon.cpp",
57    "src/i18n_addon.cpp",
58    "src/i18n_calendar_addon.cpp",
59    "src/i18n_normalizer_addon.cpp",
60    "src/i18n_system_addon.cpp",
61    "src/i18n_timezone_addon.cpp",
62    "src/i18n_unicode_addon.cpp",
63    "src/js_utils.cpp",
64    "src/system_locale_manager_addon.cpp",
65    "src/variable_convertor.cpp",
66  ]
67  deps = [
68    "//base/global/i18n/frameworks/intl:intl_util",
69    "//base/global/i18n/frameworks/intl:preferred_language",
70    "//base/global/i18n/services:i18n_sa_client",
71  ]
72  external_deps = [
73    "c_utils:utils",
74    "common_event_service:cesfwk_innerkits",
75    "hilog:libhilog",
76    "icu:shared_icui18n",
77    "icu:shared_icuuc",
78    "ipc:ipc_core",
79    "libphonenumber:phonenumber_standard",
80    "libpng:libpng",
81    "libxml2:libxml2",
82    "napi:ace_napi",
83    "preferences:native_preferences",
84    "samgr:samgr_proxy",
85  ]
86
87  defines = []
88  if (i18n_support_app_preferred_language) {
89    defines += [ "SUPPORT_APP_PREFERRED_LANGUAGE" ]
90  }
91  if (i18n_support_ui) {
92    external_deps += [ "ability_base:configuration" ]
93    defines += [ "SUPPORT_GRAPHICS" ]
94  }
95  relative_install_dir = "module"
96  subsystem_name = "global"
97  part_name = "i18n"
98}
99