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