• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/ohos.gni")
15import("//third_party/icu/icu4c/icu4c_config.gni")
16
17config("icu_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "//third_party/icu/icu4c/source/common",
21    "//third_party/icu/icu4c/source/i18n",
22    "//third_party/icu/icu4c/source",
23    "//third_party/icu/icu4c/source/tools/toolutil",
24    "//third_party/icu/icu4c/source/io",
25  ]
26}
27
28ohos_shared_library("shared_icuuc_host") {
29  configs = [
30    ":icu_config",
31    "//build/config/compiler:rtti",
32  ]
33
34  defines = [
35    "U_ATTRIBUTE_DEPRECATED=",
36    "U_COMMON_IMPLEMENTATION",
37    "UPRV_BLOCK_MACRO_BEGIN=",
38    "UPRV_BLOCK_MACRO_END=",
39    "UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0",
40    "_REENTRANT",
41    "DISTRO_TZDATA_DIR=\"/system/etc/tzdata_distro\"",
42    "SYSTEM_TZDATA_DIR=\"/system/etc/icu_tzdata\"",
43  ]
44  sources = [
45    "//third_party/icu/icu4c/source/common/appendable.cpp",
46    "//third_party/icu/icu4c/source/common/bmpset.cpp",
47    "//third_party/icu/icu4c/source/common/brkeng.cpp",
48    "//third_party/icu/icu4c/source/common/brkiter.cpp",
49    "//third_party/icu/icu4c/source/common/bytesinkutil.cpp",
50    "//third_party/icu/icu4c/source/common/bytestream.cpp",
51    "//third_party/icu/icu4c/source/common/bytestrie.cpp",
52    "//third_party/icu/icu4c/source/common/bytestriebuilder.cpp",
53    "//third_party/icu/icu4c/source/common/bytestrieiterator.cpp",
54    "//third_party/icu/icu4c/source/common/caniter.cpp",
55    "//third_party/icu/icu4c/source/common/characterproperties.cpp",
56    "//third_party/icu/icu4c/source/common/chariter.cpp",
57    "//third_party/icu/icu4c/source/common/charstr.cpp",
58    "//third_party/icu/icu4c/source/common/cmemory.cpp",
59    "//third_party/icu/icu4c/source/common/cstr.cpp",
60    "//third_party/icu/icu4c/source/common/cstring.cpp",
61    "//third_party/icu/icu4c/source/common/cwchar.cpp",
62    "//third_party/icu/icu4c/source/common/dictbe.cpp",
63    "//third_party/icu/icu4c/source/common/dictionarydata.cpp",
64    "//third_party/icu/icu4c/source/common/dtintrv.cpp",
65    "//third_party/icu/icu4c/source/common/edits.cpp",
66    "//third_party/icu/icu4c/source/common/emojiprops.cpp",
67    "//third_party/icu/icu4c/source/common/errorcode.cpp",
68    "//third_party/icu/icu4c/source/common/filteredbrk.cpp",
69    "//third_party/icu/icu4c/source/common/filterednormalizer2.cpp",
70    "//third_party/icu/icu4c/source/common/icudataver.cpp",
71    "//third_party/icu/icu4c/source/common/icuplug.cpp",
72    "//third_party/icu/icu4c/source/common/loadednormalizer2impl.cpp",
73    "//third_party/icu/icu4c/source/common/localebuilder.cpp",
74    "//third_party/icu/icu4c/source/common/localematcher.cpp",
75    "//third_party/icu/icu4c/source/common/localeprioritylist.cpp",
76    "//third_party/icu/icu4c/source/common/locavailable.cpp",
77    "//third_party/icu/icu4c/source/common/locbased.cpp",
78    "//third_party/icu/icu4c/source/common/locdispnames.cpp",
79    "//third_party/icu/icu4c/source/common/locdistance.cpp",
80    "//third_party/icu/icu4c/source/common/locdspnm.cpp",
81    "//third_party/icu/icu4c/source/common/locid.cpp",
82    "//third_party/icu/icu4c/source/common/loclikely.cpp",
83    "//third_party/icu/icu4c/source/common/loclikelysubtags.cpp",
84    "//third_party/icu/icu4c/source/common/locmap.cpp",
85    "//third_party/icu/icu4c/source/common/locresdata.cpp",
86    "//third_party/icu/icu4c/source/common/locutil.cpp",
87    "//third_party/icu/icu4c/source/common/lsr.cpp",
88    "//third_party/icu/icu4c/source/common/lstmbe.cpp",
89    "//third_party/icu/icu4c/source/common/messagepattern.cpp",
90    "//third_party/icu/icu4c/source/common/normalizer2.cpp",
91    "//third_party/icu/icu4c/source/common/normalizer2impl.cpp",
92    "//third_party/icu/icu4c/source/common/normlzr.cpp",
93    "//third_party/icu/icu4c/source/common/parsepos.cpp",
94    "//third_party/icu/icu4c/source/common/patternprops.cpp",
95    "//third_party/icu/icu4c/source/common/pluralmap.cpp",
96    "//third_party/icu/icu4c/source/common/propname.cpp",
97    "//third_party/icu/icu4c/source/common/propsvec.cpp",
98    "//third_party/icu/icu4c/source/common/punycode.cpp",
99    "//third_party/icu/icu4c/source/common/putil.cpp",
100    "//third_party/icu/icu4c/source/common/rbbi.cpp",
101    "//third_party/icu/icu4c/source/common/rbbi_cache.cpp",
102    "//third_party/icu/icu4c/source/common/rbbidata.cpp",
103    "//third_party/icu/icu4c/source/common/rbbinode.cpp",
104    "//third_party/icu/icu4c/source/common/rbbirb.cpp",
105    "//third_party/icu/icu4c/source/common/rbbiscan.cpp",
106    "//third_party/icu/icu4c/source/common/rbbisetb.cpp",
107    "//third_party/icu/icu4c/source/common/rbbistbl.cpp",
108    "//third_party/icu/icu4c/source/common/rbbitblb.cpp",
109    "//third_party/icu/icu4c/source/common/resbund.cpp",
110    "//third_party/icu/icu4c/source/common/resbund_cnv.cpp",
111    "//third_party/icu/icu4c/source/common/resource.cpp",
112    "//third_party/icu/icu4c/source/common/restrace.cpp",
113    "//third_party/icu/icu4c/source/common/ruleiter.cpp",
114    "//third_party/icu/icu4c/source/common/schriter.cpp",
115    "//third_party/icu/icu4c/source/common/serv.cpp",
116    "//third_party/icu/icu4c/source/common/servlk.cpp",
117    "//third_party/icu/icu4c/source/common/servlkf.cpp",
118    "//third_party/icu/icu4c/source/common/servls.cpp",
119    "//third_party/icu/icu4c/source/common/servnotf.cpp",
120    "//third_party/icu/icu4c/source/common/servrbf.cpp",
121    "//third_party/icu/icu4c/source/common/servslkf.cpp",
122    "//third_party/icu/icu4c/source/common/sharedobject.cpp",
123    "//third_party/icu/icu4c/source/common/simpleformatter.cpp",
124    "//third_party/icu/icu4c/source/common/static_unicode_sets.cpp",
125    "//third_party/icu/icu4c/source/common/stringpiece.cpp",
126    "//third_party/icu/icu4c/source/common/stringtriebuilder.cpp",
127    "//third_party/icu/icu4c/source/common/uarrsort.cpp",
128    "//third_party/icu/icu4c/source/common/ubidi.cpp",
129    "//third_party/icu/icu4c/source/common/ubidi_props.cpp",
130    "//third_party/icu/icu4c/source/common/ubidiln.cpp",
131    "//third_party/icu/icu4c/source/common/ubiditransform.cpp",
132    "//third_party/icu/icu4c/source/common/ubidiwrt.cpp",
133    "//third_party/icu/icu4c/source/common/ubrk.cpp",
134    "//third_party/icu/icu4c/source/common/ucase.cpp",
135    "//third_party/icu/icu4c/source/common/ucasemap.cpp",
136    "//third_party/icu/icu4c/source/common/ucasemap_titlecase_brkiter.cpp",
137    "//third_party/icu/icu4c/source/common/ucat.cpp",
138    "//third_party/icu/icu4c/source/common/uchar.cpp",
139    "//third_party/icu/icu4c/source/common/ucharstrie.cpp",
140    "//third_party/icu/icu4c/source/common/ucharstriebuilder.cpp",
141    "//third_party/icu/icu4c/source/common/ucharstrieiterator.cpp",
142    "//third_party/icu/icu4c/source/common/uchriter.cpp",
143    "//third_party/icu/icu4c/source/common/ucln_cmn.cpp",
144    "//third_party/icu/icu4c/source/common/ucmndata.cpp",
145    "//third_party/icu/icu4c/source/common/ucnv.cpp",
146    "//third_party/icu/icu4c/source/common/ucnv2022.cpp",
147    "//third_party/icu/icu4c/source/common/ucnv_bld.cpp",
148    "//third_party/icu/icu4c/source/common/ucnv_cb.cpp",
149    "//third_party/icu/icu4c/source/common/ucnv_cnv.cpp",
150    "//third_party/icu/icu4c/source/common/ucnv_ct.cpp",
151    "//third_party/icu/icu4c/source/common/ucnv_err.cpp",
152    "//third_party/icu/icu4c/source/common/ucnv_ext.cpp",
153    "//third_party/icu/icu4c/source/common/ucnv_io.cpp",
154    "//third_party/icu/icu4c/source/common/ucnv_lmb.cpp",
155    "//third_party/icu/icu4c/source/common/ucnv_set.cpp",
156    "//third_party/icu/icu4c/source/common/ucnv_u16.cpp",
157    "//third_party/icu/icu4c/source/common/ucnv_u32.cpp",
158    "//third_party/icu/icu4c/source/common/ucnv_u7.cpp",
159    "//third_party/icu/icu4c/source/common/ucnv_u8.cpp",
160    "//third_party/icu/icu4c/source/common/ucnvbocu.cpp",
161    "//third_party/icu/icu4c/source/common/ucnvdisp.cpp",
162    "//third_party/icu/icu4c/source/common/ucnvhz.cpp",
163    "//third_party/icu/icu4c/source/common/ucnvisci.cpp",
164    "//third_party/icu/icu4c/source/common/ucnvlat1.cpp",
165    "//third_party/icu/icu4c/source/common/ucnvmbcs.cpp",
166    "//third_party/icu/icu4c/source/common/ucnvscsu.cpp",
167    "//third_party/icu/icu4c/source/common/ucnvsel.cpp",
168    "//third_party/icu/icu4c/source/common/ucol_swp.cpp",
169    "//third_party/icu/icu4c/source/common/ucptrie.cpp",
170    "//third_party/icu/icu4c/source/common/ucurr.cpp",
171    "//third_party/icu/icu4c/source/common/udata.cpp",
172    "//third_party/icu/icu4c/source/common/udatamem.cpp",
173    "//third_party/icu/icu4c/source/common/udataswp.cpp",
174    "//third_party/icu/icu4c/source/common/uenum.cpp",
175    "//third_party/icu/icu4c/source/common/uhash.cpp",
176    "//third_party/icu/icu4c/source/common/uhash_us.cpp",
177    "//third_party/icu/icu4c/source/common/uidna.cpp",
178    "//third_party/icu/icu4c/source/common/uinit.cpp",
179    "//third_party/icu/icu4c/source/common/uinvchar.cpp",
180    "//third_party/icu/icu4c/source/common/uiter.cpp",
181    "//third_party/icu/icu4c/source/common/ulist.cpp",
182    "//third_party/icu/icu4c/source/common/uloc.cpp",
183    "//third_party/icu/icu4c/source/common/uloc_keytype.cpp",
184    "//third_party/icu/icu4c/source/common/uloc_tag.cpp",
185    "//third_party/icu/icu4c/source/common/umapfile.cpp",
186    "//third_party/icu/icu4c/source/common/umath.cpp",
187    "//third_party/icu/icu4c/source/common/umutablecptrie.cpp",
188    "//third_party/icu/icu4c/source/common/umutex.cpp",
189    "//third_party/icu/icu4c/source/common/unames.cpp",
190    "//third_party/icu/icu4c/source/common/unifiedcache.cpp",
191    "//third_party/icu/icu4c/source/common/unifilt.cpp",
192    "//third_party/icu/icu4c/source/common/unifunct.cpp",
193    "//third_party/icu/icu4c/source/common/uniset.cpp",
194    "//third_party/icu/icu4c/source/common/uniset_closure.cpp",
195    "//third_party/icu/icu4c/source/common/uniset_props.cpp",
196    "//third_party/icu/icu4c/source/common/unisetspan.cpp",
197    "//third_party/icu/icu4c/source/common/unistr.cpp",
198    "//third_party/icu/icu4c/source/common/unistr_case.cpp",
199    "//third_party/icu/icu4c/source/common/unistr_case_locale.cpp",
200    "//third_party/icu/icu4c/source/common/unistr_cnv.cpp",
201    "//third_party/icu/icu4c/source/common/unistr_props.cpp",
202    "//third_party/icu/icu4c/source/common/unistr_titlecase_brkiter.cpp",
203    "//third_party/icu/icu4c/source/common/unorm.cpp",
204    "//third_party/icu/icu4c/source/common/unormcmp.cpp",
205    "//third_party/icu/icu4c/source/common/uobject.cpp",
206    "//third_party/icu/icu4c/source/common/uprops.cpp",
207    "//third_party/icu/icu4c/source/common/ures_cnv.cpp",
208    "//third_party/icu/icu4c/source/common/uresbund.cpp",
209    "//third_party/icu/icu4c/source/common/uresdata.cpp",
210    "//third_party/icu/icu4c/source/common/usc_impl.cpp",
211    "//third_party/icu/icu4c/source/common/uscript.cpp",
212    "//third_party/icu/icu4c/source/common/uscript_props.cpp",
213    "//third_party/icu/icu4c/source/common/uset.cpp",
214    "//third_party/icu/icu4c/source/common/uset_props.cpp",
215    "//third_party/icu/icu4c/source/common/usetiter.cpp",
216    "//third_party/icu/icu4c/source/common/ushape.cpp",
217    "//third_party/icu/icu4c/source/common/usprep.cpp",
218    "//third_party/icu/icu4c/source/common/ustack.cpp",
219    "//third_party/icu/icu4c/source/common/ustr_cnv.cpp",
220    "//third_party/icu/icu4c/source/common/ustr_titlecase_brkiter.cpp",
221    "//third_party/icu/icu4c/source/common/ustr_wcs.cpp",
222    "//third_party/icu/icu4c/source/common/ustrcase.cpp",
223    "//third_party/icu/icu4c/source/common/ustrcase_locale.cpp",
224    "//third_party/icu/icu4c/source/common/ustrenum.cpp",
225    "//third_party/icu/icu4c/source/common/ustrfmt.cpp",
226    "//third_party/icu/icu4c/source/common/ustring.cpp",
227    "//third_party/icu/icu4c/source/common/ustrtrns.cpp",
228    "//third_party/icu/icu4c/source/common/utext.cpp",
229    "//third_party/icu/icu4c/source/common/utf_impl.cpp",
230    "//third_party/icu/icu4c/source/common/util.cpp",
231    "//third_party/icu/icu4c/source/common/util_props.cpp",
232    "//third_party/icu/icu4c/source/common/utrace.cpp",
233    "//third_party/icu/icu4c/source/common/utrie.cpp",
234    "//third_party/icu/icu4c/source/common/utrie2.cpp",
235    "//third_party/icu/icu4c/source/common/utrie2_builder.cpp",
236    "//third_party/icu/icu4c/source/common/utrie_swap.cpp",
237    "//third_party/icu/icu4c/source/common/uts46.cpp",
238    "//third_party/icu/icu4c/source/common/utypes.cpp",
239    "//third_party/icu/icu4c/source/common/uvector.cpp",
240    "//third_party/icu/icu4c/source/common/uvectr32.cpp",
241    "//third_party/icu/icu4c/source/common/uvectr64.cpp",
242    "//third_party/icu/icu4c/source/common/wintz.cpp",
243    "//third_party/icu/icu4c/source/ohos/init_data.cpp",
244    "//third_party/icu/icu4c/source/stubdata/stubdata.cpp",
245  ]
246  cflags_cc = [
247    "-O3",
248    "-W",
249    "-Wall",
250    "-pedantic",
251    "-Wpointer-arith",
252    "-Wpointer-arith",
253    "-Wwrite-strings",
254    "-Wno-error=unused-parameter",
255    "-Wno-error=unused-const-variable",
256    "-Wno-error=unneeded-internal-declaration",
257    "-Wignored-attributes",
258    "-std=c++11",
259    "-Wno-ignored-attributes",
260  ]
261  ldflags = [
262    "-shared",
263    "-lm",
264  ]
265  part_name = "$icu_part_name"
266  subsystem_name = "$icu_subsystem_name"
267  output_name = "hmicuuchost"
268}
269
270group("icuuc_host") {
271  deps = [ ":shared_icuuc_host(${host_toolchain})" ]
272}
273
274group("icuuc_win") {
275  deps = [ ":shared_icuuc_host(//build/toolchain/mingw:mingw_x86_64)" ]
276}
277
278group("icui18n_host") {
279  deps = [ "//third_party/icu/icu4c:shared_icui18n(${host_toolchain})" ]
280}
281
282ohos_shared_library("shared_icutu") {
283  configs = [
284    ":icu_config",
285    "//build/config/compiler:rtti",
286  ]
287  deps = [
288    ":icui18n_host",
289    ":icuuc_host",
290  ]
291  defines = [
292    "U_ATTRIBUTE_DEPRECATED=",
293    "U_TOOLUTIL_IMPLEMENTATION",
294    "UPRV_BLOCK_MACRO_BEGIN=",
295    "UPRV_BLOCK_MACRO_END=",
296    "_REENTRANT",
297  ]
298  sources = [
299    "//third_party/icu/icu4c/source/tools/toolutil/collationinfo.cpp",
300    "//third_party/icu/icu4c/source/tools/toolutil/dbgutil.cpp",
301    "//third_party/icu/icu4c/source/tools/toolutil/denseranges.cpp",
302    "//third_party/icu/icu4c/source/tools/toolutil/filestrm.cpp",
303    "//third_party/icu/icu4c/source/tools/toolutil/filetools.cpp",
304    "//third_party/icu/icu4c/source/tools/toolutil/flagparser.cpp",
305    "//third_party/icu/icu4c/source/tools/toolutil/package.cpp",
306    "//third_party/icu/icu4c/source/tools/toolutil/pkg_genc.cpp",
307    "//third_party/icu/icu4c/source/tools/toolutil/pkg_gencmn.cpp",
308    "//third_party/icu/icu4c/source/tools/toolutil/pkg_icu.cpp",
309    "//third_party/icu/icu4c/source/tools/toolutil/pkgitems.cpp",
310    "//third_party/icu/icu4c/source/tools/toolutil/ppucd.cpp",
311    "//third_party/icu/icu4c/source/tools/toolutil/swapimpl.cpp",
312    "//third_party/icu/icu4c/source/tools/toolutil/toolutil.cpp",
313    "//third_party/icu/icu4c/source/tools/toolutil/ucbuf.cpp",
314    "//third_party/icu/icu4c/source/tools/toolutil/ucln_tu.cpp",
315    "//third_party/icu/icu4c/source/tools/toolutil/ucm.cpp",
316    "//third_party/icu/icu4c/source/tools/toolutil/ucmstate.cpp",
317    "//third_party/icu/icu4c/source/tools/toolutil/udbgutil.cpp",
318    "//third_party/icu/icu4c/source/tools/toolutil/unewdata.cpp",
319    "//third_party/icu/icu4c/source/tools/toolutil/uoptions.cpp",
320    "//third_party/icu/icu4c/source/tools/toolutil/uparse.cpp",
321    "//third_party/icu/icu4c/source/tools/toolutil/writesrc.cpp",
322    "//third_party/icu/icu4c/source/tools/toolutil/xmlparser.cpp",
323  ]
324  cflags_cc = [
325    "-O3",
326    "-W",
327    "-Wall",
328    "-pedantic",
329    "-Wpointer-arith",
330    "-Wwrite-strings",
331    "-Wno-long-long",
332    "-Wno-error=unused-parameter",
333    "-D_REENTRANT",
334    "-DU_HAVE_ELF_H=1",
335    "-DU_HAVE_STRTOD_L=1",
336    "-DU_HAVE_XLOCALE_H=0",
337    "-DU_BUILD=\"x86_64-pc-linux-gnu\"",
338    "-DU_HOST=\"x86_64-pc-linux-gnu\"",
339    "-DU_CC=\"gcc\"",
340    "-DU_CXX=\"g++\"",
341    "-std=c++11",
342    "-DUNISTR_FROM_CHAR_EXPLICIT=explicit",
343    "-DUNISTR_FROM_STRING_EXPLICIT=explicit",
344    "-DU_ATTRIBUTE_DEPRECATED=",
345    "-Wno-ignored-attributes",
346  ]
347  ldflags = [
348    "-shared",
349    "-lm",
350  ]
351  part_name = "$icu_part_name"
352  subsystem_name = "$icu_subsystem_name"
353  output_name = "hmicutuhost"
354}
355
356ohos_shared_library("shared_icuio") {
357  configs = [
358    ":icu_config",
359    "//build/config/compiler:rtti",
360  ]
361  deps = [
362    ":icui18n_host",
363    ":icuuc_host",
364  ]
365  defines = [
366    "U_ATTRIBUTE_DEPRECATED=",
367    "UPRV_BLOCK_MACRO_BEGIN=",
368    "UPRV_BLOCK_MACRO_END=",
369    "U_IO_IMPLEMENTATION",
370    "_REENTRANT",
371  ]
372  sources = [
373    "//third_party/icu/icu4c/source/io/locbund.cpp",
374    "//third_party/icu/icu4c/source/io/sprintf.cpp",
375    "//third_party/icu/icu4c/source/io/sscanf.cpp",
376    "//third_party/icu/icu4c/source/io/ucln_io.cpp",
377    "//third_party/icu/icu4c/source/io/ufile.cpp",
378    "//third_party/icu/icu4c/source/io/ufmt_cmn.cpp",
379    "//third_party/icu/icu4c/source/io/uprintf.cpp",
380    "//third_party/icu/icu4c/source/io/uprntf_p.cpp",
381    "//third_party/icu/icu4c/source/io/uscanf.cpp",
382    "//third_party/icu/icu4c/source/io/uscanf_p.cpp",
383    "//third_party/icu/icu4c/source/io/ustdio.cpp",
384    "//third_party/icu/icu4c/source/io/ustream.cpp",
385  ]
386  cflags_cc = [
387    "-O3",
388    "-W",
389    "-Wall",
390    "-pedantic",
391    "-Wpointer-arith",
392    "-Wwrite-strings",
393    "-Wno-error=unused-parameter",
394    "-Wno-error=unused-const-variable",
395    "-Wno-error=unneeded-internal-declaration",
396    "-std=c++11",
397    "-Wno-ignored-attributes",
398  ]
399  ldflags = [
400    "-shared",
401    "-lm",
402  ]
403  part_name = "$icu_part_name"
404  subsystem_name = "$icu_subsystem_name"
405  output_name = "hmicuio"
406}
407
408group("lib_host") {
409  deps = [
410    ":icui18n_host",
411    ":icuuc_host",
412    ":shared_icuio(${host_toolchain})",
413    ":shared_icutu(${host_toolchain})",
414  ]
415}
416
417ohos_executable("genbrk") {
418  configs = [
419    ":icu_config",
420    "//build/config/compiler:rtti",
421  ]
422  deps = [ ":lib_host" ]
423  sources = [ "//third_party/icu/icu4c/source/tools/genbrk/genbrk.cpp" ]
424  cflags_cc = [
425    "-O3",
426    "-W",
427    "-Wall",
428    "-pedantic",
429    "-Wpointer-arith",
430    "-Wwrite-strings",
431    "-std=c++11",
432  ]
433  ldflags = [
434    "-ldl",
435    "-lm",
436  ]
437  part_name = "$icu_part_name"
438  subsystem_name = "$icu_subsystem_name"
439  output_name = "genbrk"
440}
441
442ohos_executable("genccode") {
443  configs = [
444    ":icu_config",
445    "//build/config/compiler:rtti",
446  ]
447  deps = [ ":lib_host" ]
448  sources = [ "//third_party/icu/icu4c/source/tools/genccode/genccode.c" ]
449  cflags_cc = [
450    "-O3",
451    "-W",
452    "-Wall",
453    "-pedantic",
454    "-Wpointer-arith",
455    "-Wwrite-strings",
456    "-std=c++11",
457  ]
458  ldflags = [
459    "-ldl",
460    "-lm",
461  ]
462  part_name = "$icu_part_name"
463  subsystem_name = "$icu_subsystem_name"
464  output_name = "genccode"
465}
466
467ohos_executable("gencfu") {
468  configs = [
469    ":icu_config",
470    "//build/config/compiler:rtti",
471  ]
472  deps = [ ":lib_host" ]
473  sources = [ "//third_party/icu/icu4c/source/tools/gencfu/gencfu.cpp" ]
474  cflags_cc = [
475    "-O3",
476    "-W",
477    "-Wall",
478    "-pedantic",
479    "-Wpointer-arith",
480    "-Wwrite-strings",
481    "-std=c++11",
482  ]
483  ldflags = [
484    "-ldl",
485    "-lm",
486  ]
487  part_name = "$icu_part_name"
488  subsystem_name = "$icu_subsystem_name"
489  output_name = "gencfu"
490}
491
492ohos_executable("gencnval") {
493  configs = [
494    ":icu_config",
495    "//build/config/compiler:rtti",
496  ]
497  deps = [ ":lib_host" ]
498  sources = [ "//third_party/icu/icu4c/source/tools/gencnval/gencnval.c" ]
499  cflags_cc = [
500    "-O3",
501    "-W",
502    "-Wall",
503    "-pedantic",
504    "-Wpointer-arith",
505    "-Wwrite-strings",
506    "-std=c++11",
507  ]
508  ldflags = [
509    "-ldl",
510    "-lm",
511  ]
512  part_name = "$icu_part_name"
513  subsystem_name = "$icu_subsystem_name"
514  output_name = "gencnval"
515}
516
517ohos_executable("gendict") {
518  configs = [
519    ":icu_config",
520    "//build/config/compiler:rtti",
521  ]
522  deps = [ ":lib_host" ]
523  sources = [ "//third_party/icu/icu4c/source/tools/gendict/gendict.cpp" ]
524  cflags_cc = [
525    "-O3",
526    "-W",
527    "-Wall",
528    "-pedantic",
529    "-Wpointer-arith",
530    "-Wwrite-strings",
531    "-std=c++11",
532  ]
533  ldflags = [
534    "-ldl",
535    "-lm",
536  ]
537  part_name = "$icu_part_name"
538  subsystem_name = "$icu_subsystem_name"
539  output_name = "gendict"
540}
541
542ohos_static_library("genrb_c") {
543  configs = [
544    ":icu_config",
545    "//build/config/compiler:rtti",
546  ]
547  deps = [ ":lib_host" ]
548  sources = [
549    "//third_party/icu/icu4c/source/tools/genrb/errmsg.c",
550    "//third_party/icu/icu4c/source/tools/genrb/rbutil.c",
551    "//third_party/icu/icu4c/source/tools/genrb/read.c",
552    "//third_party/icu/icu4c/source/tools/genrb/rle.c",
553    "//third_party/icu/icu4c/source/tools/genrb/ustr.c",
554  ]
555  cflags_c = [
556    "-O3",
557    "-std=c11",
558    "-Wall",
559    "-pedantic",
560    "-Wshadow",
561    "-Wpointer-arith",
562    "-Wmissing-prototypes",
563    "-Wwrite-strings",
564    "-D_REENTRANT",
565    "-DUNISTR_FROM_CHAR_EXPLICIT=explicit",
566    "-DUNISTR_FROM_STRING_EXPLICIT=explicit",
567    "-DU_ATTRIBUTE_DEPRECATED=",
568    "-Wno-sign-compare",
569    "-Wno-error=strict-prototypes",
570    "-Wno-error=unused-but-set-variable",
571  ]
572  ldflags = [
573    "-ldl",
574    "-lm",
575  ]
576  part_name = "$icu_part_name"
577  subsystem_name = "$icu_subsystem_name"
578}
579ohos_executable("genrb") {
580  configs = [
581    ":icu_config",
582    "//build/config/compiler:rtti",
583  ]
584  deps = [
585    ":genrb_c(${host_toolchain})",
586    ":lib_host",
587  ]
588  sources = [
589    "//third_party/icu/icu4c/source/tools/genrb/filterrb.cpp",
590    "//third_party/icu/icu4c/source/tools/genrb/genrb.cpp",
591    "//third_party/icu/icu4c/source/tools/genrb/parse.cpp",
592    "//third_party/icu/icu4c/source/tools/genrb/prscmnts.cpp",
593    "//third_party/icu/icu4c/source/tools/genrb/reslist.cpp",
594    "//third_party/icu/icu4c/source/tools/genrb/wrtjava.cpp",
595    "//third_party/icu/icu4c/source/tools/genrb/wrtxml.cpp",
596  ]
597  cflags_cc = [
598    "-O3",
599    "-W",
600    "-Wall",
601    "-pedantic",
602    "-Wpointer-arith",
603    "-Wwrite-strings",
604    "-Wno-long-long",
605    "-D_REENTRANT",
606    "-DU_HAVE_ELF_H=1",
607    "-DU_HAVE_XLOCALE_H=0",
608    "-std=c++11",
609    "-DUNISTR_FROM_CHAR_EXPLICIT=explicit",
610    "-DUNISTR_FROM_STRING_EXPLICIT=explicit",
611    "-DU_ATTRIBUTE_DEPRECATED=",
612    "-Wno-unused-but-set-variable",
613  ]
614  ldflags = [
615    "-ldl",
616    "-lm",
617  ]
618  part_name = "$icu_part_name"
619  subsystem_name = "$icu_subsystem_name"
620  output_name = "genrb"
621}
622
623ohos_executable("derb") {
624  configs = [
625    ":icu_config",
626    "//build/config/compiler:rtti",
627  ]
628  deps = [ ":lib_host" ]
629  sources = [ "//third_party/icu/icu4c/source/tools/genrb/derb.cpp" ]
630  cflags_cc = [
631    "-O3",
632    "-W",
633    "-Wall",
634    "-pedantic",
635    "-Wpointer-arith",
636    "-Wwrite-strings",
637    "-std=c++11",
638  ]
639  ldflags = [
640    "-ldl",
641    "-lm",
642  ]
643  part_name = "$icu_part_name"
644  subsystem_name = "$icu_subsystem_name"
645  output_name = "derb"
646}
647
648ohos_executable("makeconv") {
649  configs = [
650    ":icu_config",
651    "//build/config/compiler:rtti",
652  ]
653  deps = [ ":lib_host" ]
654  sources = [
655    "//third_party/icu/icu4c/source/tools/makeconv/gencnvex.c",
656    "//third_party/icu/icu4c/source/tools/makeconv/genmbcs.cpp",
657    "//third_party/icu/icu4c/source/tools/makeconv/makeconv.cpp",
658    "//third_party/icu/icu4c/source/tools/makeconv/ucnvstat.c",
659  ]
660  cflags_cc = [
661    "-O3",
662    "-W",
663    "-Wall",
664    "-pedantic",
665    "-Wpointer-arith",
666    "-Wwrite-strings",
667    "-std=c++11",
668  ]
669  ldflags = [
670    "-ldl",
671    "-lm",
672  ]
673  part_name = "$icu_part_name"
674  subsystem_name = "$icu_subsystem_name"
675  output_name = "makeconv"
676}
677
678ohos_executable("gensprep") {
679  configs = [
680    ":icu_config",
681    "//build/config/compiler:rtti",
682  ]
683  deps = [ ":lib_host" ]
684  sources = [
685    "//third_party/icu/icu4c/source/tools/gensprep/gensprep.c",
686    "//third_party/icu/icu4c/source/tools/gensprep/store.c",
687  ]
688  cflags_cc = [
689    "-O3",
690    "-W",
691    "-Wall",
692    "-pedantic",
693    "-Wpointer-arith",
694    "-Wwrite-strings",
695    "-std=c++11",
696  ]
697  ldflags = [
698    "-ldl",
699    "-lm",
700  ]
701  part_name = "$icu_part_name"
702  subsystem_name = "$icu_subsystem_name"
703  output_name = "gensprep"
704}
705
706ohos_executable("icupkg") {
707  configs = [
708    ":icu_config",
709    "//build/config/compiler:rtti",
710  ]
711  deps = [ ":lib_host" ]
712  sources = [ "//third_party/icu/icu4c/source/tools/icupkg/icupkg.cpp" ]
713  cflags_cc = [
714    "-O3",
715    "-W",
716    "-Wall",
717    "-pedantic",
718    "-Wpointer-arith",
719    "-Wwrite-strings",
720    "-std=c++11",
721  ]
722  ldflags = [
723    "-ldl",
724    "-lm",
725  ]
726  part_name = "$icu_part_name"
727  subsystem_name = "$icu_subsystem_name"
728  output_name = "icupkg"
729}
730
731ohos_executable("pkgdata") {
732  configs = [
733    ":icu_config",
734    "//build/config/compiler:rtti",
735  ]
736  deps = [
737    ":lib_host",
738    ":shared_icutu(${host_toolchain})",
739  ]
740  sources = [
741    "//third_party/icu/icu4c/source/tools/pkgdata/pkgdata.cpp",
742    "//third_party/icu/icu4c/source/tools/pkgdata/pkgtypes.c",
743  ]
744  cflags_cc = [
745    "-O3",
746    "-W",
747    "-Wall",
748    "-pedantic",
749    "-Wpointer-arith",
750    "-Wwrite-strings",
751    "-std=c++11",
752  ]
753  ldflags = [
754    "-ldl",
755    "-lm",
756  ]
757  part_name = "$icu_part_name"
758  subsystem_name = "$icu_subsystem_name"
759  output_name = "pkgdata"
760}
761group("bin_host") {
762  deps = [
763    ":genbrk(${host_toolchain})",
764    ":genccode(${host_toolchain})",
765    ":gencfu(${host_toolchain})",
766    ":gencnval(${host_toolchain})",
767    ":gendict(${host_toolchain})",
768    ":genrb(${host_toolchain})",
769    ":gensprep(${host_toolchain})",
770    ":icupkg(${host_toolchain})",
771    ":makeconv(${host_toolchain})",
772    ":pkgdata(${host_toolchain})",
773  ]
774}
775