OLD | NEW |
| (Empty) |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import("//third_party/icu/config.gni") | |
6 | |
7 # Meta target that includes both icuuc and icui18n. Most targets want both. | |
8 # You can depend on the individually if you need to. | |
9 group("icu") { | |
10 deps = [ | |
11 ":icui18n", | |
12 ":icuuc", | |
13 ] | |
14 } | |
15 | |
16 # Shared config used by ICU and all dependents. | |
17 config("icu_config") { | |
18 defines = [ | |
19 "U_USING_ICU_NAMESPACE=0", | |
20 "U_ENABLE_DYLOAD=0", | |
21 ] | |
22 | |
23 if (component_mode != "shared_library") { | |
24 defines += [ "U_STATIC_IMPLEMENTATION" ] | |
25 } | |
26 | |
27 include_dirs = [ | |
28 "source/common", | |
29 "source/i18n", | |
30 ] | |
31 } | |
32 | |
33 # Config used only by ICU code. | |
34 config("icu_code") { | |
35 cflags = [] | |
36 if (is_win) { | |
37 # Disable some compiler warnings. | |
38 cflags += [ | |
39 "/wd4005", # Macro redefinition. | |
40 "/wd4068", # Unknown pragmas. | |
41 "/wd4267", # Conversion from size_t on 64-bits. | |
42 "/wd4996", # Deprecated functions. | |
43 ] | |
44 } else if (is_linux) { | |
45 cflags += [ | |
46 # Since ICU wants to internally use its own deprecated APIs, don't | |
47 # complain about it. | |
48 "-Wno-deprecated-declarations", | |
49 "-Wno-unused-function", | |
50 ] | |
51 } | |
52 if (is_clang) { | |
53 cflags += [ | |
54 "-Wno-deprecated-declarations", | |
55 "-Wno-logical-op-parentheses", | |
56 "-Wno-tautological-compare", | |
57 "-Wno-switch", | |
58 ] | |
59 } | |
60 } | |
61 | |
62 component("icui18n") { | |
63 sources = [ | |
64 "source/i18n/alphaindex.cpp", | |
65 "source/i18n/anytrans.cpp", | |
66 "source/i18n/astro.cpp", | |
67 "source/i18n/basictz.cpp", | |
68 "source/i18n/bocsu.cpp", | |
69 "source/i18n/brktrans.cpp", | |
70 "source/i18n/buddhcal.cpp", | |
71 "source/i18n/calendar.cpp", | |
72 "source/i18n/casetrn.cpp", | |
73 "source/i18n/cecal.cpp", | |
74 "source/i18n/chnsecal.cpp", | |
75 "source/i18n/choicfmt.cpp", | |
76 "source/i18n/coleitr.cpp", | |
77 "source/i18n/collationbasedatabuilder.cpp", | |
78 "source/i18n/collationbuilder.cpp", | |
79 "source/i18n/collationcompare.cpp", | |
80 "source/i18n/collation.cpp", | |
81 "source/i18n/collationdatabuilder.cpp", | |
82 "source/i18n/collationdata.cpp", | |
83 "source/i18n/collationdatareader.cpp", | |
84 "source/i18n/collationdatawriter.cpp", | |
85 "source/i18n/collationfastlatinbuilder.cpp", | |
86 "source/i18n/collationfastlatin.cpp", | |
87 "source/i18n/collationfcd.cpp", | |
88 "source/i18n/collationiterator.cpp", | |
89 "source/i18n/collationkeys.cpp", | |
90 "source/i18n/collationroot.cpp", | |
91 "source/i18n/collationrootelements.cpp", | |
92 "source/i18n/collationruleparser.cpp", | |
93 "source/i18n/collationsets.cpp", | |
94 "source/i18n/collationsettings.cpp", | |
95 "source/i18n/collationtailoring.cpp", | |
96 "source/i18n/collationweights.cpp", | |
97 "source/i18n/coll.cpp", | |
98 "source/i18n/compactdecimalformat.cpp", | |
99 "source/i18n/coptccal.cpp", | |
100 "source/i18n/cpdtrans.cpp", | |
101 "source/i18n/csdetect.cpp", | |
102 "source/i18n/csmatch.cpp", | |
103 "source/i18n/csr2022.cpp", | |
104 "source/i18n/csrecog.cpp", | |
105 "source/i18n/csrmbcs.cpp", | |
106 "source/i18n/csrsbcs.cpp", | |
107 "source/i18n/csrucode.cpp", | |
108 "source/i18n/csrutf8.cpp", | |
109 "source/i18n/curramt.cpp", | |
110 "source/i18n/currfmt.cpp", | |
111 "source/i18n/currpinf.cpp", | |
112 "source/i18n/currunit.cpp", | |
113 "source/i18n/dangical.cpp", | |
114 "source/i18n/datefmt.cpp", | |
115 "source/i18n/dcfmtsym.cpp", | |
116 "source/i18n/decContext.c", | |
117 "source/i18n/decfmtst.cpp", | |
118 "source/i18n/decimalformatpattern.cpp", | |
119 "source/i18n/decimfmt.cpp", | |
120 "source/i18n/decNumber.c", | |
121 "source/i18n/digitlst.cpp", | |
122 "source/i18n/dtfmtsym.cpp", | |
123 "source/i18n/dtitvfmt.cpp", | |
124 "source/i18n/dtitvinf.cpp", | |
125 "source/i18n/dtptngen.cpp", | |
126 "source/i18n/dtrule.cpp", | |
127 "source/i18n/esctrn.cpp", | |
128 "source/i18n/ethpccal.cpp", | |
129 "source/i18n/filteredbrk.cpp", | |
130 "source/i18n/fmtable_cnv.cpp", | |
131 "source/i18n/fmtable.cpp", | |
132 "source/i18n/format.cpp", | |
133 "source/i18n/fphdlimp.cpp", | |
134 "source/i18n/fpositer.cpp", | |
135 "source/i18n/funcrepl.cpp", | |
136 "source/i18n/gender.cpp", | |
137 "source/i18n/gregocal.cpp", | |
138 "source/i18n/gregoimp.cpp", | |
139 "source/i18n/hebrwcal.cpp", | |
140 "source/i18n/identifier_info.cpp", | |
141 "source/i18n/indiancal.cpp", | |
142 "source/i18n/inputext.cpp", | |
143 "source/i18n/islamcal.cpp", | |
144 "source/i18n/japancal.cpp", | |
145 "source/i18n/locdspnm.cpp", | |
146 "source/i18n/measfmt.cpp", | |
147 "source/i18n/measunit.cpp", | |
148 "source/i18n/measure.cpp", | |
149 "source/i18n/msgfmt.cpp", | |
150 "source/i18n/name2uni.cpp", | |
151 "source/i18n/nfrs.cpp", | |
152 "source/i18n/nfrule.cpp", | |
153 "source/i18n/nfsubs.cpp", | |
154 "source/i18n/nortrans.cpp", | |
155 "source/i18n/nultrans.cpp", | |
156 "source/i18n/numfmt.cpp", | |
157 "source/i18n/numsys.cpp", | |
158 "source/i18n/olsontz.cpp", | |
159 "source/i18n/persncal.cpp", | |
160 "source/i18n/plurfmt.cpp", | |
161 "source/i18n/plurrule.cpp", | |
162 "source/i18n/quant.cpp", | |
163 "source/i18n/quantityformatter.cpp", | |
164 "source/i18n/rbnf.cpp", | |
165 "source/i18n/rbt.cpp", | |
166 "source/i18n/rbt_data.cpp", | |
167 "source/i18n/rbt_pars.cpp", | |
168 "source/i18n/rbt_rule.cpp", | |
169 "source/i18n/rbt_set.cpp", | |
170 "source/i18n/rbtz.cpp", | |
171 "source/i18n/regexcmp.cpp", | |
172 "source/i18n/regeximp.cpp", | |
173 "source/i18n/regexst.cpp", | |
174 "source/i18n/regextxt.cpp", | |
175 "source/i18n/region.cpp", | |
176 "source/i18n/reldatefmt.cpp", | |
177 "source/i18n/reldtfmt.cpp", | |
178 "source/i18n/rematch.cpp", | |
179 "source/i18n/remtrans.cpp", | |
180 "source/i18n/repattrn.cpp", | |
181 "source/i18n/rulebasedcollator.cpp", | |
182 "source/i18n/scientificformathelper.cpp", | |
183 "source/i18n/scriptset.cpp", | |
184 "source/i18n/search.cpp", | |
185 "source/i18n/selfmt.cpp", | |
186 "source/i18n/sharedbreakiterator.cpp", | |
187 "source/i18n/simpletz.cpp", | |
188 "source/i18n/smpdtfmt.cpp", | |
189 "source/i18n/smpdtfst.cpp", | |
190 "source/i18n/sortkey.cpp", | |
191 "source/i18n/strmatch.cpp", | |
192 "source/i18n/strrepl.cpp", | |
193 "source/i18n/stsearch.cpp", | |
194 "source/i18n/taiwncal.cpp", | |
195 "source/i18n/timezone.cpp", | |
196 "source/i18n/titletrn.cpp", | |
197 "source/i18n/tmunit.cpp", | |
198 "source/i18n/tmutamt.cpp", | |
199 "source/i18n/tmutfmt.cpp", | |
200 "source/i18n/tolowtrn.cpp", | |
201 "source/i18n/toupptrn.cpp", | |
202 "source/i18n/translit.cpp", | |
203 "source/i18n/transreg.cpp", | |
204 "source/i18n/tridpars.cpp", | |
205 "source/i18n/tzfmt.cpp", | |
206 "source/i18n/tzgnames.cpp", | |
207 "source/i18n/tznames.cpp", | |
208 "source/i18n/tznames_impl.cpp", | |
209 "source/i18n/tzrule.cpp", | |
210 "source/i18n/tztrans.cpp", | |
211 "source/i18n/ucal.cpp", | |
212 "source/i18n/ucln_in.cpp", | |
213 "source/i18n/ucol.cpp", | |
214 "source/i18n/ucoleitr.cpp", | |
215 "source/i18n/ucol_res.cpp", | |
216 "source/i18n/ucol_sit.cpp", | |
217 "source/i18n/ucsdet.cpp", | |
218 "source/i18n/ucurr.cpp", | |
219 "source/i18n/udat.cpp", | |
220 "source/i18n/udateintervalformat.cpp", | |
221 "source/i18n/udatpg.cpp", | |
222 "source/i18n/uitercollationiterator.cpp", | |
223 "source/i18n/ulocdata.c", | |
224 "source/i18n/umsg.cpp", | |
225 "source/i18n/unesctrn.cpp", | |
226 "source/i18n/uni2name.cpp", | |
227 "source/i18n/unum.cpp", | |
228 "source/i18n/unumsys.cpp", | |
229 "source/i18n/upluralrules.cpp", | |
230 "source/i18n/uregexc.cpp", | |
231 "source/i18n/uregex.cpp", | |
232 "source/i18n/uregion.cpp", | |
233 "source/i18n/usearch.cpp", | |
234 "source/i18n/uspoof_build.cpp", | |
235 "source/i18n/uspoof_conf.cpp", | |
236 "source/i18n/uspoof.cpp", | |
237 "source/i18n/uspoof_impl.cpp", | |
238 "source/i18n/uspoof_wsconf.cpp", | |
239 "source/i18n/utf16collationiterator.cpp", | |
240 "source/i18n/utf8collationiterator.cpp", | |
241 "source/i18n/utmscale.c", | |
242 "source/i18n/utrans.cpp", | |
243 "source/i18n/vtzone.cpp", | |
244 "source/i18n/vzone.cpp", | |
245 "source/i18n/windtfmt.cpp", | |
246 "source/i18n/winnmfmt.cpp", | |
247 "source/i18n/wintzimpl.cpp", | |
248 "source/i18n/zonemeta.cpp", | |
249 "source/i18n/zrule.cpp", | |
250 "source/i18n/ztrans.cpp", | |
251 ] | |
252 defines = [ "U_I18N_IMPLEMENTATION" ] | |
253 deps = [ | |
254 ":icuuc", | |
255 ] | |
256 | |
257 # ICU uses RTTI, replace the default "no rtti" config. | |
258 configs -= [ | |
259 "//build/config/compiler:no_rtti", # ICU uses RTTI. | |
260 "//build/config/compiler:chromium_code", | |
261 ] | |
262 configs += [ | |
263 "//build/config/compiler:rtti", | |
264 "//build/config/compiler:no_chromium_code", | |
265 ] | |
266 | |
267 configs += [ ":icu_code" ] | |
268 public_configs = [ ":icu_config" ] | |
269 | |
270 cflags = [] | |
271 if (is_android || is_linux) { | |
272 cflags += [ | |
273 # ICU uses its own deprecated functions. | |
274 "-Wno-deprecated-declarations", | |
275 ] | |
276 } | |
277 if (is_clang) { | |
278 # uspoof.h has a U_NAMESPACE_USE macro. That's a bug, | |
279 # the header should use U_NAMESPACE_BEGIN instead. | |
280 # http://bugs.icu-project.org/trac/ticket/9054 | |
281 configs -= [ "//build/config/clang:extra_warnings" ] | |
282 | |
283 cflags += [ | |
284 "-Wno-header-hygiene", | |
285 | |
286 # Looks like a real issue, see http://crbug.com/114660 | |
287 "-Wno-return-type-c-linkage", | |
288 ] | |
289 } | |
290 } | |
291 | |
292 component("icuuc") { | |
293 sources = [ | |
294 "source/common/appendable.cpp", | |
295 "source/common/bmpset.cpp", | |
296 "source/common/brkeng.cpp", | |
297 "source/common/brkiter.cpp", | |
298 "source/common/bytestream.cpp", | |
299 "source/common/bytestriebuilder.cpp", | |
300 "source/common/bytestrie.cpp", | |
301 "source/common/bytestrieiterator.cpp", | |
302 "source/common/caniter.cpp", | |
303 "source/common/chariter.cpp", | |
304 "source/common/charstr.cpp", | |
305 "source/common/cmemory.c", | |
306 "source/common/cstring.c", | |
307 "source/common/cwchar.c", | |
308 "source/common/dictbe.cpp", | |
309 "source/common/dictionarydata.cpp", | |
310 "source/common/dtintrv.cpp", | |
311 "source/common/errorcode.cpp", | |
312 "source/common/filterednormalizer2.cpp", | |
313 "source/common/icudataver.c", | |
314 "source/common/icuplug.cpp", | |
315 "source/common/listformatter.cpp", | |
316 "source/common/loadednormalizer2impl.cpp", | |
317 "source/common/locavailable.cpp", | |
318 "source/common/locbased.cpp", | |
319 "source/common/locdispnames.cpp", | |
320 "source/common/locid.cpp", | |
321 "source/common/loclikely.cpp", | |
322 "source/common/locmap.c", | |
323 "source/common/locresdata.cpp", | |
324 "source/common/locutil.cpp", | |
325 "source/common/messagepattern.cpp", | |
326 "source/common/normalizer2.cpp", | |
327 "source/common/normalizer2impl.cpp", | |
328 "source/common/normlzr.cpp", | |
329 "source/common/parsepos.cpp", | |
330 "source/common/patternprops.cpp", | |
331 "source/common/propname.cpp", | |
332 "source/common/propsvec.c", | |
333 "source/common/punycode.cpp", | |
334 "source/common/putil.cpp", | |
335 "source/common/rbbi.cpp", | |
336 "source/common/rbbidata.cpp", | |
337 "source/common/rbbinode.cpp", | |
338 "source/common/rbbirb.cpp", | |
339 "source/common/rbbiscan.cpp", | |
340 "source/common/rbbisetb.cpp", | |
341 "source/common/rbbistbl.cpp", | |
342 "source/common/rbbitblb.cpp", | |
343 "source/common/resbund_cnv.cpp", | |
344 "source/common/resbund.cpp", | |
345 "source/common/ruleiter.cpp", | |
346 "source/common/schriter.cpp", | |
347 "source/common/serv.cpp", | |
348 "source/common/servlk.cpp", | |
349 "source/common/servlkf.cpp", | |
350 "source/common/servls.cpp", | |
351 "source/common/servnotf.cpp", | |
352 "source/common/servrbf.cpp", | |
353 "source/common/servslkf.cpp", | |
354 "source/common/sharedobject.cpp", | |
355 "source/common/simplepatternformatter.cpp", | |
356 "source/common/stringpiece.cpp", | |
357 "source/common/stringtriebuilder.cpp", | |
358 "source/common/uarrsort.c", | |
359 "source/common/ubidi.c", | |
360 "source/common/ubidiln.c", | |
361 "source/common/ubidi_props.c", | |
362 "source/common/ubidiwrt.c", | |
363 "source/common/ubrk.cpp", | |
364 "source/common/ucase.cpp", | |
365 "source/common/ucasemap.cpp", | |
366 "source/common/ucasemap_titlecase_brkiter.cpp", | |
367 "source/common/ucat.c", | |
368 "source/common/uchar.c", | |
369 "source/common/ucharstriebuilder.cpp", | |
370 "source/common/ucharstrie.cpp", | |
371 "source/common/ucharstrieiterator.cpp", | |
372 "source/common/uchriter.cpp", | |
373 "source/common/ucln_cmn.cpp", | |
374 "source/common/ucmndata.c", | |
375 "source/common/ucnv2022.cpp", | |
376 "source/common/ucnv_bld.cpp", | |
377 "source/common/ucnvbocu.cpp", | |
378 "source/common/ucnv.c", | |
379 "source/common/ucnv_cb.c", | |
380 "source/common/ucnv_cnv.c", | |
381 "source/common/ucnv_ct.c", | |
382 "source/common/ucnvdisp.c", | |
383 "source/common/ucnv_err.c", | |
384 "source/common/ucnv_ext.cpp", | |
385 "source/common/ucnvhz.c", | |
386 "source/common/ucnv_io.cpp", | |
387 "source/common/ucnvisci.c", | |
388 "source/common/ucnvlat1.c", | |
389 "source/common/ucnv_lmb.c", | |
390 "source/common/ucnvmbcs.cpp", | |
391 "source/common/ucnvscsu.c", | |
392 "source/common/ucnvsel.cpp", | |
393 "source/common/ucnv_set.c", | |
394 "source/common/ucnv_u16.c", | |
395 "source/common/ucnv_u32.c", | |
396 "source/common/ucnv_u7.c", | |
397 "source/common/ucnv_u8.c", | |
398 "source/common/ucol_swp.cpp", | |
399 "source/common/udata.cpp", | |
400 "source/common/udatamem.c", | |
401 "source/common/udataswp.c", | |
402 "source/common/uenum.c", | |
403 "source/common/uhash.c", | |
404 "source/common/uhash_us.cpp", | |
405 "source/common/uidna.cpp", | |
406 "source/common/uinit.cpp", | |
407 "source/common/uinvchar.c", | |
408 "source/common/uiter.cpp", | |
409 "source/common/ulist.c", | |
410 "source/common/uloc.cpp", | |
411 "source/common/uloc_keytype.cpp", | |
412 "source/common/uloc_tag.c", | |
413 "source/common/umapfile.c", | |
414 "source/common/umath.c", | |
415 "source/common/umutex.cpp", | |
416 "source/common/unames.cpp", | |
417 "source/common/unifiedcache.cpp", | |
418 "source/common/unifilt.cpp", | |
419 "source/common/unifunct.cpp", | |
420 "source/common/uniset_closure.cpp", | |
421 "source/common/uniset.cpp", | |
422 "source/common/uniset_props.cpp", | |
423 "source/common/unisetspan.cpp", | |
424 "source/common/unistr_case.cpp", | |
425 "source/common/unistr_case_locale.cpp", | |
426 "source/common/unistr_cnv.cpp", | |
427 "source/common/unistr.cpp", | |
428 "source/common/unistr_props.cpp", | |
429 "source/common/unistr_titlecase_brkiter.cpp", | |
430 "source/common/unormcmp.cpp", | |
431 "source/common/unorm.cpp", | |
432 "source/common/uobject.cpp", | |
433 "source/common/uprops.cpp", | |
434 "source/common/uresbund.cpp", | |
435 "source/common/ures_cnv.c", | |
436 "source/common/uresdata.c", | |
437 "source/common/usc_impl.c", | |
438 "source/common/uscript.c", | |
439 "source/common/uscript_props.cpp", | |
440 "source/common/uset.cpp", | |
441 "source/common/usetiter.cpp", | |
442 "source/common/uset_props.cpp", | |
443 "source/common/ushape.cpp", | |
444 "source/common/usprep.cpp", | |
445 "source/common/ustack.cpp", | |
446 "source/common/ustrcase.cpp", | |
447 "source/common/ustrcase_locale.cpp", | |
448 "source/common/ustr_cnv.cpp", | |
449 "source/common/ustrenum.cpp", | |
450 "source/common/ustrfmt.c", | |
451 "source/common/ustring.cpp", | |
452 "source/common/ustr_titlecase_brkiter.cpp", | |
453 "source/common/ustrtrns.cpp", | |
454 "source/common/ustr_wcs.cpp", | |
455 "source/common/utext.cpp", | |
456 "source/common/utf_impl.c", | |
457 "source/common/util.cpp", | |
458 "source/common/util_props.cpp", | |
459 "source/common/utrace.c", | |
460 "source/common/utrie2_builder.cpp", | |
461 "source/common/utrie2.cpp", | |
462 "source/common/utrie.cpp", | |
463 "source/common/uts46.cpp", | |
464 "source/common/utypes.c", | |
465 "source/common/uvector.cpp", | |
466 "source/common/uvectr32.cpp", | |
467 "source/common/uvectr64.cpp", | |
468 "source/common/wintz.c", | |
469 ] | |
470 defines = [ "U_COMMON_IMPLEMENTATION" ] | |
471 deps = [ | |
472 ":icudata", | |
473 ] | |
474 configs += [ ":icu_code" ] | |
475 | |
476 configs -= [ | |
477 "//build/config/compiler:no_rtti", # ICU uses RTTI. | |
478 "//build/config/compiler:chromium_code", | |
479 ] | |
480 configs += [ | |
481 "//build/config/compiler:rtti", | |
482 "//build/config/compiler:no_chromium_code", | |
483 ] | |
484 | |
485 public_configs = [ ":icu_config" ] | |
486 | |
487 if (is_win || icu_use_data_file) { | |
488 sources += [ "source/stubdata/stubdata.c" ] | |
489 defines += [ "U_ICUDATAENTRY_IN_COMMON" ] | |
490 } | |
491 } | |
492 | |
493 # TODO(GYP) support use_system_icu. | |
494 if (icu_use_data_file) { | |
495 if (is_ios) { | |
496 # TODO(GYP): Support mac resource bundle shown below. | |
497 # 'link_settings': { | |
498 # 'mac_bundle_resources': [ | |
499 # 'source/data/in/icudtl.dat', | |
500 # ], | |
501 # } | |
502 } else { | |
503 copy("icudata") { | |
504 if (is_android) { | |
505 sources = [ | |
506 "android/icudtl.dat", | |
507 ] | |
508 } else { | |
509 sources = [ | |
510 "source/data/in/icudtl.dat", | |
511 ] | |
512 } | |
513 | |
514 outputs = [ | |
515 "$root_out_dir/icudtl.dat", | |
516 ] | |
517 } | |
518 } | |
519 } else { | |
520 if (is_win) { | |
521 # On Windows the target DLL is pre-built so just use a copy rule. | |
522 copy("icudata") { | |
523 sources = [ | |
524 "windows/icudt.dll", | |
525 ] | |
526 outputs = [ | |
527 "$root_out_dir/icudt.dll", | |
528 ] | |
529 } | |
530 } else { | |
531 source_set("icudata") { | |
532 # These are hand-generated, but will do for now. | |
533 # | |
534 # TODO(GYP): Gyp has considerations here for QNX and for the host toolchai
n | |
535 # that have not been ported over. | |
536 if (is_linux) { | |
537 sources = [ | |
538 "linux/icudtl_dat.S", | |
539 ] | |
540 } else if (is_mac) { | |
541 sources = [ | |
542 "mac/icudtl_dat.S", | |
543 ] | |
544 } else if (is_android) { | |
545 sources = [ | |
546 "android/icudtl_dat.S", | |
547 ] | |
548 } else { | |
549 assert(false, "No icu data for this platform") | |
550 } | |
551 defines = [ "U_HIDE_DATA_SYMBOL" ] | |
552 } | |
553 } | |
554 } | |
OLD | NEW |