1 # Copyright (c) 2012 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 # Shared config used by ICU and all dependents. 6 config("icu_config") { 7 defines = [ 8 "U_USING_ICU_NAMESPACE=0", 9 ] 10 include_dirs = [ 11 "source/common", 12 "source/i18n", 13 ] 14 } 15 16 # Config used only by ICU code. 17 config("icu_code") { 18 if (component_mode == "static_library") { 19 defines = [ "U_STATIC_IMPLEMENTATION" ] 20 } 21 22 if (is_win) { 23 # Disable some compiler warnings. 24 cflags = [ 25 "/wd4005", # Macro redefinition. 26 "/wd4068", # Unknown pragmas. 27 "/wd4267", # Conversion from size_t on 64-bits. 28 "/wd4996", # Deprecated functions. 29 ] 30 } else if (is_linux) { 31 cflags = [ 32 # Since ICU wants to internally use its own deprecated APIs, don't 33 # complain about it. 34 "-Wno-deprecated-declarations", 35 "-Wno-unused-function", 36 ] 37 } else if (is_clang) { 38 cflags = [ 39 "-Wno-deprecated-declarations", 40 "-Wno-logical-op-parentheses", 41 "-Wno-tautological-compare", 42 "-Wno-switch", 43 ] 44 } 45 } 46 47 component("icui18n") { 48 external = true 49 sources = [ 50 "source/i18n/anytrans.cpp", 51 "source/i18n/astro.cpp", 52 "source/i18n/basictz.cpp", 53 "source/i18n/bms.cpp", 54 "source/i18n/bmsearch.cpp", 55 "source/i18n/bocsu.c", 56 "source/i18n/brktrans.cpp", 57 "source/i18n/buddhcal.cpp", 58 "source/i18n/calendar.cpp", 59 "source/i18n/casetrn.cpp", 60 "source/i18n/cecal.cpp", 61 "source/i18n/chnsecal.cpp", 62 "source/i18n/choicfmt.cpp", 63 "source/i18n/coleitr.cpp", 64 "source/i18n/coll.cpp", 65 "source/i18n/colldata.cpp", 66 "source/i18n/coptccal.cpp", 67 "source/i18n/cpdtrans.cpp", 68 "source/i18n/csdetect.cpp", 69 "source/i18n/csmatch.cpp", 70 "source/i18n/csr2022.cpp", 71 "source/i18n/csrecog.cpp", 72 "source/i18n/csrmbcs.cpp", 73 "source/i18n/csrsbcs.cpp", 74 "source/i18n/csrucode.cpp", 75 "source/i18n/csrutf8.cpp", 76 "source/i18n/curramt.cpp", 77 "source/i18n/currfmt.cpp", 78 "source/i18n/currpinf.cpp", 79 "source/i18n/currunit.cpp", 80 "source/i18n/datefmt.cpp", 81 "source/i18n/dcfmtsym.cpp", 82 "source/i18n/decContext.c", 83 "source/i18n/decNumber.c", 84 "source/i18n/decimfmt.cpp", 85 "source/i18n/digitlst.cpp", 86 "source/i18n/dtfmtsym.cpp", 87 "source/i18n/dtitvfmt.cpp", 88 "source/i18n/dtitvinf.cpp", 89 "source/i18n/dtptngen.cpp", 90 "source/i18n/dtrule.cpp", 91 "source/i18n/esctrn.cpp", 92 "source/i18n/ethpccal.cpp", 93 "source/i18n/fmtable.cpp", 94 "source/i18n/fmtable_cnv.cpp", 95 "source/i18n/format.cpp", 96 "source/i18n/fphdlimp.cpp", 97 "source/i18n/fpositer.cpp", 98 "source/i18n/funcrepl.cpp", 99 "source/i18n/gregocal.cpp", 100 "source/i18n/gregoimp.cpp", 101 "source/i18n/hebrwcal.cpp", 102 "source/i18n/indiancal.cpp", 103 "source/i18n/inputext.cpp", 104 "source/i18n/islamcal.cpp", 105 "source/i18n/japancal.cpp", 106 "source/i18n/locdspnm.cpp", 107 "source/i18n/measfmt.cpp", 108 "source/i18n/measure.cpp", 109 "source/i18n/msgfmt.cpp", 110 "source/i18n/name2uni.cpp", 111 "source/i18n/nfrs.cpp", 112 "source/i18n/nfrule.cpp", 113 "source/i18n/nfsubs.cpp", 114 "source/i18n/nortrans.cpp", 115 "source/i18n/nultrans.cpp", 116 "source/i18n/numfmt.cpp", 117 "source/i18n/numsys.cpp", 118 "source/i18n/olsontz.cpp", 119 "source/i18n/persncal.cpp", 120 "source/i18n/plurfmt.cpp", 121 "source/i18n/plurrule.cpp", 122 "source/i18n/quant.cpp", 123 "source/i18n/rbnf.cpp", 124 "source/i18n/rbt.cpp", 125 "source/i18n/rbt_data.cpp", 126 "source/i18n/rbt_pars.cpp", 127 "source/i18n/rbt_rule.cpp", 128 "source/i18n/rbt_set.cpp", 129 "source/i18n/rbtz.cpp", 130 "source/i18n/regexcmp.cpp", 131 "source/i18n/regexst.cpp", 132 "source/i18n/regextxt.cpp", 133 "source/i18n/reldtfmt.cpp", 134 "source/i18n/rematch.cpp", 135 "source/i18n/remtrans.cpp", 136 "source/i18n/repattrn.cpp", 137 "source/i18n/search.cpp", 138 "source/i18n/selfmt.cpp", 139 "source/i18n/simpletz.cpp", 140 "source/i18n/smpdtfmt.cpp", 141 "source/i18n/sortkey.cpp", 142 "source/i18n/strmatch.cpp", 143 "source/i18n/strrepl.cpp", 144 "source/i18n/stsearch.cpp", 145 "source/i18n/taiwncal.cpp", 146 "source/i18n/tblcoll.cpp", 147 "source/i18n/timezone.cpp", 148 "source/i18n/titletrn.cpp", 149 "source/i18n/tmunit.cpp", 150 "source/i18n/tmutamt.cpp", 151 "source/i18n/tmutfmt.cpp", 152 "source/i18n/tolowtrn.cpp", 153 "source/i18n/toupptrn.cpp", 154 "source/i18n/translit.cpp", 155 "source/i18n/transreg.cpp", 156 "source/i18n/tridpars.cpp", 157 "source/i18n/tzrule.cpp", 158 "source/i18n/tztrans.cpp", 159 "source/i18n/ucal.cpp", 160 "source/i18n/ucln_in.c", 161 "source/i18n/ucol.cpp", 162 "source/i18n/ucol_bld.cpp", 163 "source/i18n/ucol_cnt.cpp", 164 "source/i18n/ucol_elm.cpp", 165 "source/i18n/ucol_res.cpp", 166 "source/i18n/ucol_sit.cpp", 167 "source/i18n/ucol_tok.cpp", 168 "source/i18n/ucol_wgt.cpp", 169 "source/i18n/ucoleitr.cpp", 170 "source/i18n/ucsdet.cpp", 171 "source/i18n/ucurr.cpp", 172 "source/i18n/udat.cpp", 173 "source/i18n/udatpg.cpp", 174 "source/i18n/ulocdata.c", 175 "source/i18n/umsg.cpp", 176 "source/i18n/unesctrn.cpp", 177 "source/i18n/uni2name.cpp", 178 "source/i18n/unum.cpp", 179 "source/i18n/uregex.cpp", 180 "source/i18n/uregexc.cpp", 181 "source/i18n/usearch.cpp", 182 "source/i18n/uspoof.cpp", 183 "source/i18n/uspoof_build.cpp", 184 "source/i18n/uspoof_conf.cpp", 185 "source/i18n/uspoof_impl.cpp", 186 "source/i18n/uspoof_wsconf.cpp", 187 "source/i18n/utmscale.c", 188 "source/i18n/utrans.cpp", 189 "source/i18n/vtzone.cpp", 190 "source/i18n/vzone.cpp", 191 "source/i18n/windtfmt.cpp", 192 "source/i18n/winnmfmt.cpp", 193 "source/i18n/wintzimpl.cpp", 194 "source/i18n/zonemeta.cpp", 195 "source/i18n/zrule.cpp", 196 "source/i18n/zstrfmt.cpp", 197 "source/i18n/ztrans.cpp", 198 ] 199 defines = [ 200 "U_I18N_IMPLEMENTATION", 201 ] 202 deps = [ 203 ":icuuc", 204 ] 205 206 # ICU uses RTTI, replace the default "no rtti" config. 207 configs -= [ 208 "//build/config/compiler:no_rtti", # ICU uses RTTI. 209 "//build/config/compiler:chromium_code", 210 ] 211 configs += [ 212 "//build/config/compiler:rtti", 213 "//build/config/compiler:no_chromium_code", 214 ] 215 216 configs += [ ":icu_code" ] 217 direct_dependent_configs = [ ":icu_config" ] 218 } 219 220 component("icuuc") { 221 external = true 222 sources = [ 223 "source/common/bmpset.cpp", 224 "source/common/brkeng.cpp", 225 "source/common/brkiter.cpp", 226 "source/common/bytestream.cpp", 227 "source/common/caniter.cpp", 228 "source/common/chariter.cpp", 229 "source/common/charstr.cpp", 230 "source/common/cmemory.c", 231 "source/common/cstring.c", 232 "source/common/cwchar.c", 233 "source/common/dictbe.cpp", 234 "source/common/dtintrv.cpp", 235 "source/common/errorcode.cpp", 236 "source/common/filterednormalizer2.cpp", 237 "source/common/icudataver.c", 238 "source/common/icuplug.c", 239 "source/common/locavailable.cpp", 240 "source/common/locbased.cpp", 241 "source/common/locdispnames.cpp", 242 "source/common/locid.cpp", 243 "source/common/loclikely.cpp", 244 "source/common/locmap.c", 245 "source/common/locresdata.cpp", 246 "source/common/locutil.cpp", 247 "source/common/mutex.cpp", 248 "source/common/normalizer2.cpp", 249 "source/common/normalizer2impl.cpp", 250 "source/common/normlzr.cpp", 251 "source/common/parsepos.cpp", 252 "source/common/propname.cpp", 253 "source/common/propsvec.c", 254 "source/common/punycode.c", 255 "source/common/putil.c", 256 "source/common/rbbi.cpp", 257 "source/common/rbbidata.cpp", 258 "source/common/rbbinode.cpp", 259 "source/common/rbbirb.cpp", 260 "source/common/rbbiscan.cpp", 261 "source/common/rbbisetb.cpp", 262 "source/common/rbbistbl.cpp", 263 "source/common/rbbitblb.cpp", 264 "source/common/resbund.cpp", 265 "source/common/resbund_cnv.cpp", 266 "source/common/ruleiter.cpp", 267 "source/common/schriter.cpp", 268 "source/common/serv.cpp", 269 "source/common/servlk.cpp", 270 "source/common/servlkf.cpp", 271 "source/common/servls.cpp", 272 "source/common/servnotf.cpp", 273 "source/common/servrbf.cpp", 274 "source/common/servslkf.cpp", 275 "source/common/stringpiece.cpp", 276 "source/common/triedict.cpp", 277 "source/common/uarrsort.c", 278 "source/common/ubidi.c", 279 "source/common/ubidi_props.c", 280 "source/common/ubidiln.c", 281 "source/common/ubidiwrt.c", 282 "source/common/ubrk.cpp", 283 "source/common/ucase.c", 284 "source/common/ucasemap.c", 285 "source/common/ucat.c", 286 "source/common/uchar.c", 287 "source/common/uchriter.cpp", 288 "source/common/ucln_cmn.c", 289 "source/common/ucmndata.c", 290 "source/common/ucnv.c", 291 "source/common/ucnv2022.c", 292 "source/common/ucnv_bld.c", 293 "source/common/ucnv_cb.c", 294 "source/common/ucnv_cnv.c", 295 "source/common/ucnv_err.c", 296 "source/common/ucnv_ext.c", 297 "source/common/ucnv_io.c", 298 "source/common/ucnv_lmb.c", 299 "source/common/ucnv_set.c", 300 "source/common/ucnv_u16.c", 301 "source/common/ucnv_u32.c", 302 "source/common/ucnv_u7.c", 303 "source/common/ucnv_u8.c", 304 "source/common/ucnvbocu.c", 305 "source/common/ucnvdisp.c", 306 "source/common/ucnvhz.c", 307 "source/common/ucnvisci.c", 308 "source/common/ucnvlat1.c", 309 "source/common/ucnvmbcs.c", 310 "source/common/ucnvscsu.c", 311 "source/common/ucnvsel.cpp", 312 "source/common/ucol_swp.cpp", 313 "source/common/udata.cpp", 314 "source/common/udatamem.c", 315 "source/common/udataswp.c", 316 "source/common/uenum.c", 317 "source/common/uhash.c", 318 "source/common/uhash_us.cpp", 319 "source/common/uidna.cpp", 320 "source/common/uinit.c", 321 "source/common/uinvchar.c", 322 "source/common/uiter.cpp", 323 "source/common/ulist.c", 324 "source/common/uloc.c", 325 "source/common/uloc_tag.c", 326 "source/common/umapfile.c", 327 "source/common/umath.c", 328 "source/common/umutex.c", 329 "source/common/unames.c", 330 "source/common/unifilt.cpp", 331 "source/common/unifunct.cpp", 332 "source/common/uniset.cpp", 333 "source/common/uniset_props.cpp", 334 "source/common/unisetspan.cpp", 335 "source/common/unistr.cpp", 336 "source/common/unistr_case.cpp", 337 "source/common/unistr_cnv.cpp", 338 "source/common/unistr_props.cpp", 339 "source/common/unorm.cpp", 340 "source/common/unorm_it.c", 341 "source/common/unormcmp.cpp", 342 "source/common/uobject.cpp", 343 "source/common/uprops.cpp", 344 "source/common/ures_cnv.c", 345 "source/common/uresbund.c", 346 "source/common/uresdata.c", 347 "source/common/usc_impl.c", 348 "source/common/uscript.c", 349 "source/common/uset.cpp", 350 "source/common/uset_props.cpp", 351 "source/common/usetiter.cpp", 352 "source/common/ushape.c", 353 "source/common/usprep.cpp", 354 "source/common/ustack.cpp", 355 "source/common/ustr_cnv.c", 356 "source/common/ustr_wcs.c", 357 "source/common/ustrcase.c", 358 "source/common/ustrenum.cpp", 359 "source/common/ustrfmt.c", 360 "source/common/ustring.c", 361 "source/common/ustrtrns.c", 362 "source/common/utext.cpp", 363 "source/common/utf_impl.c", 364 "source/common/util.cpp", 365 "source/common/util_props.cpp", 366 "source/common/utrace.c", 367 "source/common/utrie.c", 368 "source/common/utrie2.cpp", 369 "source/common/utrie2_builder.c", 370 "source/common/uts46.cpp", 371 "source/common/utypes.c", 372 "source/common/uvector.cpp", 373 "source/common/uvectr32.cpp", 374 "source/common/uvectr64.cpp", 375 "source/common/wintz.c", 376 "source/stubdata/stubdata.c", 377 ] 378 defines = [ 379 "U_COMMON_IMPLEMENTATION", 380 ] 381 deps = [ 382 ":icudata", 383 ] 384 configs += [ ":icu_code" ] 385 386 configs -= [ 387 "//build/config/compiler:no_rtti", # ICU uses RTTI. 388 "//build/config/compiler:chromium_code", 389 ] 390 configs += [ 391 "//build/config/compiler:rtti", 392 "//build/config/compiler:no_chromium_code", 393 ] 394 395 direct_dependent_configs = [ ":icu_config" ] 396 397 if (!is_win) { 398 sources -= "source/stubdata/stubdata.c" 399 } 400 } 401 402 if (is_win) { 403 # On Windows the target DLL is pre-built so just use a copy rule. 404 copy("icudata") { 405 external = true 406 sources = [ "windows/icudt.dll" ] 407 outputs = [ "$root_out_dir/icudt.dll" ] 408 } 409 } else { 410 static_library("icudata") { 411 external = true 412 sources = [ 413 # These are hand-generated, but will do for now. The linux version is an 414 # identical copy of the (mac) icudt46l_dat.S file, modulo removal of the 415 # .private_extern and .const directives and with no leading underscore on 416 # the icudt46_dat symbol. 417 "android/icudt46l_dat.S", 418 "linux/icudt46l_dat.S", 419 "mac/icudt46l_dat.S", 420 ] 421 defines = [ "U_HIDE_DATA_SYMBOL" ] 422 423 # TODO(brettw) support use_system_icu and icu_use_data_file_flag. 424 } 425 } 426