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.
11 'icu_use_data_file_flag%': 0,
12 'want_separate_host_toolset%': 1,
15 'direct_dependent_settings': {
17 # Tell ICU to not insert |using namespace icu;| into its headers,
18 # so that chrome's source explicitly has to use |icu::|.
19 'U_USING_ICU_NAMESPACE=0',
23 'U_USING_ICU_NAMESPACE=0',
26 ['component=="static_library"', {
28 'U_STATIC_IMPLEMENTATION',
31 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
32 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
33 (target_arch=="arm" or target_arch=="ia32" or \
34 target_arch=="mipsel")', {
35 'target_conditions': [
36 ['_toolset=="host"', {
38 'ldflags': [ '-m32' ],
51 'msvs_disabled_warnings': [4005, 4068, 4355, 4996, 4267],
54 ['use_system_icu==0 or want_separate_host_toolset==1', {
57 'target_name': 'icudata',
58 'type': 'static_library',
63 # These are hand-generated, but will do for now. The linux
64 # version is an identical copy of the (mac) icudt46l_dat.S file,
65 # modulo removal of the .private_extern and .const directives and
66 # with no leading underscore on the icudt46_dat symbol.
67 'android/icudt46l_dat.S',
68 'linux/icudt46l_dat.S',
72 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
75 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
76 'toolsets': ['host', 'target'],
78 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
79 'toolsets': ['target'],
81 [ 'OS == "win" and icu_use_data_file_flag==0', {
85 'destination': '<(PRODUCT_DIR)',
92 [ 'icu_use_data_file_flag==1', {
93 # Remove any assembly data file.
94 'sources/': [['exclude', 'icudt46l_dat']],
95 # Compile in the stub data symbol.
96 'sources': ['source/stubdata/stubdata.c'],
98 # Make sure any binary depending on this gets the data file.
102 'destination': '<(PRODUCT_DIR)',
104 ['OS == "android"', {
106 'android/icudtl.dat',
108 } , { # else: OS != android
110 'source/data/in/icudtl.dat',
115 } , { # else: OS=="ios"
117 'mac_bundle_resources': [
118 'source/data/in/icudtl.dat',
123 }], # icu_use_data_file_flag
125 'target_conditions': [
126 [ 'OS == "win" or OS == "mac" or OS == "ios" or '
127 '(OS == "android" and (_toolset != "host" or host_os != "linux")) or '
128 '(OS == "qnx" and (_toolset == "host" and host_os != "linux"))', {
129 'sources!': ['linux/icudt46l_dat.S'],
131 [ 'OS != "android" or _toolset == "host"', {
132 'sources!': ['android/icudt46l_dat.S'],
134 [ 'OS != "mac" and OS != "ios" and '
135 '((OS != "android" and OS != "qnx") or '
136 '_toolset != "host" or host_os != "mac")', {
137 'sources!': ['mac/icudt46l_dat.S'],
139 ], # target_conditions
142 'target_name': 'icui18n',
143 'type': '<(component)',
145 '<@(icui18n_sources)',
148 'U_I18N_IMPLEMENTATION',
153 'direct_dependent_settings': {
159 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
160 'toolsets': ['host'],
162 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
163 'toolsets': ['host', 'target'],
165 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
166 'toolsets': ['target'],
168 [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
169 # Since ICU wants to internally use its own deprecated APIs, don't
172 '-Wno-deprecated-declarations',
178 ['OS == "mac" or OS == "ios"', {
180 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
185 'VCCLCompilerTool': {
186 'RuntimeTypeInfo': 'true',
193 # ICU uses its own deprecated functions.
194 '-Wno-deprecated-declarations',
195 # ICU prefers `a && b || c` over `(a && b) || c`.
196 '-Wno-logical-op-parentheses',
197 # ICU has some `unsigned < 0` checks.
198 '-Wno-tautological-compare',
199 # uspoof.h has a U_NAMESPACE_USE macro. That's a bug,
200 # the header should use U_NAMESPACE_BEGIN instead.
201 # http://bugs.icu-project.org/trac/ticket/9054
202 '-Wno-header-hygiene',
203 # Looks like a real issue, see http://crbug.com/114660
204 '-Wno-return-type-c-linkage',
208 '-Wno-deprecated-declarations',
209 '-Wno-logical-op-parentheses',
210 '-Wno-tautological-compare',
211 '-Wno-header-hygiene',
212 '-Wno-return-type-c-linkage',
215 ['OS == "android" and clang==0', {
216 # Disable sincos() optimization to avoid a linker error since
217 # Android's math library doesn't have sincos(). Either
218 # -fno-builtin-sin or -fno-builtin-cos works.
223 ['OS == "android" and use_system_stlport == 1', {
224 'target_conditions': [
225 ['_toolset == "target"', {
226 # ICU requires RTTI, which is not present in the system's
227 # stlport, so we have to include gabi++.
229 '<(android_src)/abi/cpp/include',
242 'target_name': 'icuuc',
243 'type': '<(component)',
248 'U_COMMON_IMPLEMENTATION',
253 'direct_dependent_settings': {
258 [ 'component=="static_library"', {
260 'U_STATIC_IMPLEMENTATION',
266 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
267 'toolsets': ['host'],
269 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
270 'toolsets': ['host', 'target'],
272 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
273 'toolsets': ['target'],
277 'source/stubdata/stubdata.c',
280 [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
282 # Since ICU wants to internally use its own deprecated APIs,
283 # don't complain about it.
284 '-Wno-deprecated-declarations',
285 '-Wno-unused-function',
291 ['OS == "mac" or OS == "ios"', {
293 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
298 'VCCLCompilerTool': {
299 'RuntimeTypeInfo': 'true',
303 ['OS == "android" and use_system_stlport == 1', {
304 'target_conditions': [
305 ['_toolset == "target"', {
306 # ICU requires RTTI, which is not present in the system's
307 # stlport, so we have to include gabi++.
309 '<(android_src)/abi/cpp/include',
322 # ICU uses its own deprecated functions.
323 '-Wno-deprecated-declarations',
324 # ICU prefers `a && b || c` over `(a && b) || c`.
325 '-Wno-logical-op-parentheses',
326 # ICU has some `unsigned < 0` checks.
327 '-Wno-tautological-compare',
328 # uresdata.c has switch(RES_GET_TYPE(x)) code. The
329 # RES_GET_TYPE macro returns an UResType enum, but some switch
330 # statement contains case values that aren't part of that
331 # enum (e.g. URES_TABLE32 which is in UResInternalType). This
337 '-Wno-deprecated-declarations',
338 '-Wno-logical-op-parentheses',
339 '-Wno-tautological-compare',
347 ['use_system_icu==1', {
350 'target_name': 'system_icu',
354 'direct_dependent_settings': {
356 '<(android_src)/external/icu4c/common',
357 '<(android_src)/external/icu4c/i18n',
375 ['OS!="android" and OS!="qnx"', {
378 '<!@(icu-config --ldflags)',
381 '<!@(icu-config --ldflags-libsonly)',
388 'target_name': 'icudata',
390 'dependencies': ['system_icu'],
391 'export_dependent_settings': ['system_icu'],
392 'toolsets': ['target'],
395 'target_name': 'icui18n',
397 'dependencies': ['system_icu'],
398 'export_dependent_settings': ['system_icu'],
400 'headers_root_path': 'source/i18n',
401 'header_filenames': [
402 # This list can easily be updated using the command below:
403 # find third_party/icu/source/i18n/unicode -iname '*.h' \
404 # -printf "'%p',\n" | \
405 # sed -e 's|third_party/icu/source/i18n/||' | sort -u
407 'unicode/bmsearch.h',
409 'unicode/calendar.h',
410 'unicode/choicfmt.h',
412 'unicode/colldata.h',
415 'unicode/currpinf.h',
416 'unicode/currunit.h',
418 'unicode/dcfmtsym.h',
419 'unicode/decimfmt.h',
420 'unicode/dtfmtsym.h',
421 'unicode/dtitvfmt.h',
422 'unicode/dtitvinf.h',
423 'unicode/dtptngen.h',
425 'unicode/fieldpos.h',
428 'unicode/fpositer.h',
429 'unicode/gregocal.h',
430 'unicode/locdspnm.h',
432 'unicode/measunit.h',
438 'unicode/plurrule.h',
444 'unicode/simpletz.h',
445 'unicode/smpdtfmt.h',
447 'unicode/stsearch.h',
449 'unicode/timezone.h',
453 'unicode/translit.h',
457 'unicode/ucoleitr.h',
463 'unicode/uldnames.h',
464 'unicode/ulocdata.h',
471 'unicode/utmscale.h',
477 '../../build/shim_headers.gypi',
479 'toolsets': ['target'],
482 'target_name': 'icuuc',
484 'dependencies': ['system_icu'],
485 'export_dependent_settings': ['system_icu'],
487 'headers_root_path': 'source/common',
488 'header_filenames': [
489 # This list can easily be updated using the command below:
490 # find third_party/icu/source/common/unicode -iname '*.h' \
491 # -printf "'%p',\n" | \
492 # sed -e 's|third_party/icu/source/common/||' | sort -u
494 'unicode/bytestream.h',
496 'unicode/chariter.h',
500 'unicode/errorcode.h',
501 'unicode/icudataver.h',
504 'unicode/localpointer.h',
506 'unicode/normalizer2.h',
508 'unicode/pandroid.h',
509 'unicode/parseerr.h',
510 'unicode/parsepos.h',
511 'unicode/pfreebsd.h',
514 'unicode/popenbsd.h',
522 'unicode/schriter.h',
523 'unicode/std_string.h',
525 'unicode/stringpiece.h',
526 'unicode/symtable.h',
529 'unicode/ucasemap.h',
532 'unicode/uchriter.h',
535 'unicode/ucnv_err.h',
540 'unicode/udeprctd.h',
544 'unicode/uintrnal.h',
547 'unicode/umachine.h',
550 'unicode/unifunct.h',
551 'unicode/unimatch.h',
557 'unicode/uobslete.h',
563 'unicode/usetiter.h',
575 'unicode/utypeinfo.h',
578 'unicode/uversion.h',
582 '../../build/shim_headers.gypi',
584 'toolsets': ['target'],