• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    ":intl_util",
20    ":preferred_language",
21  ]
22}
23
24group("geocoding_depends") {
25  deps = [ "//third_party/libphonenumber/cpp:geocoding" ]
26}
27
28config("preferred_language_config") {
29  include_dirs = [
30    "//base/global/i18n/interfaces/native/inner_api/preferred_language/include",
31  ]
32}
33ohos_shared_library("preferred_language") {
34  public_configs = [ ":preferred_language_config" ]
35  include_dirs = [ "include" ]
36  sources = [ "src/preferred_language.cpp" ]
37  cflags_cc = [
38    "-Wall",
39    "-fPIC",
40  ]
41  deps = [ "//base/global/i18n/frameworks/intl:intl_util" ]
42  external_deps = [ "init:libbegetutil" ]
43  subsystem_name = "global"
44  part_name = "i18n"
45}
46
47config("intl_util_config") {
48  include_dirs = [
49    "//third_party/icu/icu4c/source",
50    "//third_party/icu/icu4c/source/common",
51    "//third_party/icu/icu4c/source/i18n",
52    "//third_party/icu/icu4c/source/common/unicode",
53    "//base/global/i18n/frameworks/intl/include",
54    "//base/global/i18n/interfaces/native/inner_api/i18n/include",
55  ]
56}
57ohos_shared_library("intl_util") {
58  public_configs = [ ":intl_util_config" ]
59  include_dirs = [
60    "//commonlibrary/c_utils/base/include",
61    "//third_party/libxml2/include",
62    "//third_party/libphonenumber/cpp/src",
63    "//third_party/libphonenumber",
64    "//third_party/protobuf/src",
65  ]
66  sources = [
67    "src/character.cpp",
68    "src/collator.cpp",
69    "src/date_time_format.cpp",
70    "src/i18n_break_iterator.cpp",
71    "src/i18n_calendar.cpp",
72    "src/i18n_timezone.cpp",
73    "src/index_util.cpp",
74    "src/locale_config.cpp",
75    "src/locale_info.cpp",
76    "src/measure_data.cpp",
77    "src/number_format.cpp",
78    "src/phone_number_format.cpp",
79    "src/plural_rules.cpp",
80    "src/relative_time_format.cpp",
81    "src/utils.cpp",
82  ]
83  version_script = "libintl_util.map"
84  cflags_cc = [
85    "-Wall",
86    "-fPIC",
87  ]
88  deps = [
89    ":config_locales_xml",
90    ":config_regions_xml",
91    ":en_Latn_lang_xml",
92    ":en_Latn_timezone_xml",
93    ":forbidden_languages_xml",
94    ":forbidden_regions_xml",
95    ":lang_supported_locales",
96    ":language_config.para",
97    ":language_config.para.dac",
98    ":timezone_supported_locales",
99    ":white_languages_xml",
100    ":zh_Hans_lang_xml",
101    ":zh_Hans_timezone_xml",
102    "//third_party/icu/icu4c:ohos_icudat",
103    "//third_party/icu/icu4c:shared_icui18n",
104    "//third_party/icu/icu4c:shared_icuuc",
105    "//third_party/libphonenumber/cpp:phonenumber_standard",
106    "//third_party/libxml2:xml2",
107  ]
108  use_exceptions = true
109  external_deps = [
110    "access_token:libaccesstoken_sdk",
111    "c_utils:utils",
112    "hiviewdfx_hilog_native:libhilog",
113    "init:libbegetutil",
114    "ipc:ipc_core",
115  ]
116  if (i18n_support_ui) {
117    include_dirs += [
118      "//foundation/ability/ability_base/interfaces/kits/native/configuration/include",
119      "//foundation/ability/ability_runtime/interfaces/inner_api/app_manager/include/appmgr",
120      "//foundation/ability/ability_runtime/interfaces/inner_api/ability_manager/include",
121    ]
122    external_deps += [
123      "ability_base:configuration",
124      "ability_runtime:ability_manager",
125      "ability_runtime:app_manager",
126    ]
127    defines = [ "SUPPORT_GRAPHICS" ]
128  }
129  install_images = [ system_base_dir ]
130  relative_install_dir = "platformsdk"
131  subsystem_name = "global"
132  part_name = "i18n"
133}
134
135ohos_prebuilt_etc("language_config.para") {
136  source = "//base/global/i18n/frameworks/intl/etc/language_config.para"
137  part_name = "i18n"
138  module_install_dir = "etc/param"
139}
140
141ohos_prebuilt_etc("language_config.para.dac") {
142  source = "//base/global/i18n/frameworks/intl/etc/language_config.para.dac"
143  part_name = "i18n"
144  module_install_dir = "etc/param"
145}
146
147ohos_prebuilt_etc("config_locales_xml") {
148  source = "//base/global/i18n/frameworks/intl/etc/supported_locales.xml"
149  module_install_dir = "usr/ohos_locale_config/"
150  part_name = "i18n"
151  subsystem_name = "global"
152}
153
154ohos_prebuilt_etc("config_regions_xml") {
155  source = "//base/global/i18n/frameworks/intl/etc/supported_regions.xml"
156  module_install_dir = "usr/ohos_locale_config/"
157  part_name = "i18n"
158  subsystem_name = "global"
159}
160
161ohos_prebuilt_etc("white_languages_xml") {
162  source = "//base/global/i18n/frameworks/intl/etc/white_languages.xml"
163  module_install_dir = "usr/ohos_locale_config/"
164  part_name = "i18n"
165  subsystem_name = "global"
166}
167
168ohos_prebuilt_etc("forbidden_languages_xml") {
169  source = "//base/global/i18n/frameworks/intl/etc/forbidden_languages.xml"
170  module_install_dir = "usr/ohos_locale_config/"
171  part_name = "i18n"
172  subsystem_name = "global"
173}
174
175ohos_prebuilt_etc("forbidden_regions_xml") {
176  source = "//base/global/i18n/frameworks/intl/etc/forbidden_regions.xml"
177  module_install_dir = "usr/ohos_locale_config/"
178  part_name = "i18n"
179  subsystem_name = "global"
180}
181
182ohos_prebuilt_etc("lang_supported_locales") {
183  source = "//base/global/i18n/frameworks/intl/etc/lang/supported_locales.xml"
184  module_install_dir = "etc/ohos_lang_config/"
185  part_name = "i18n"
186  subsystem_name = "global"
187}
188
189ohos_prebuilt_etc("zh_Hans_lang_xml") {
190  source = "//base/global/i18n/frameworks/intl/etc/lang/zh-Hans.xml"
191  module_install_dir = "etc/ohos_lang_config/"
192  part_name = "i18n"
193  subsystem_name = "global"
194}
195
196ohos_prebuilt_etc("zh_Hans_timezone_xml") {
197  source = "//base/global/i18n/frameworks/intl/etc/timezone/zh-Hans.xml"
198  module_install_dir = "usr/ohos_timezone/"
199  part_name = "i18n"
200  subsystem_name = "global"
201}
202
203ohos_prebuilt_etc("en_Latn_lang_xml") {
204  source = "//base/global/i18n/frameworks/intl/etc/lang/en-Latn.xml"
205  module_install_dir = "etc/ohos_lang_config/"
206  part_name = "i18n"
207  subsystem_name = "global"
208}
209
210ohos_prebuilt_etc("en_Latn_timezone_xml") {
211  source = "//base/global/i18n/frameworks/intl/etc/timezone/en-Latn.xml"
212  module_install_dir = "usr/ohos_timezone/"
213  part_name = "i18n"
214  subsystem_name = "global"
215}
216
217ohos_prebuilt_etc("timezone_supported_locales") {
218  source =
219      "//base/global/i18n/frameworks/intl/etc/timezone/supported_locales.xml"
220  module_install_dir = "usr/ohos_timezone/"
221  part_name = "i18n"
222  subsystem_name = "global"
223}
224