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',
20 # We don't use ICU plugins and dyload is only necessary for them.
21 # NaCl-related builds also fail looking for dlfcn.h when it's enabled.
26 'U_USING_ICU_NAMESPACE=0',
28 # Only build encoding coverters and detectors necessary for HTML5.
29 'UCONFIG_NO_NON_HTML5_CONVERSION=1',
32 ['component=="static_library"', {
34 'U_STATIC_IMPLEMENTATION',
37 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
38 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
39 (target_arch=="arm" or target_arch=="ia32" or \
40 target_arch=="mipsel")', {
41 'target_conditions': [
42 ['_toolset=="host"', {
44 'ldflags': [ '-m32' ],
52 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
53 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
54 (target_arch=="arm64" or target_arch=="x64" or \
55 target_arch=="mipsel64")', {
56 'target_conditions': [
57 ['_toolset=="host"', {
59 'ldflags': [ '-m64' ],
62 'ARCHS': [ 'x86_64' ],
72 'msvs_disabled_warnings': [4005, 4068, 4355, 4996, 4267],
75 ['use_system_icu==0 or want_separate_host_toolset==1', {
78 'target_name': 'copy_icudtl_dat',
80 # icudtl.dat is the same for both host/target, so this only supports a
81 # single toolset. If a target requires that the .dat file be copied
82 # to the output directory, it should explicitly depend on this target
83 # with the host toolset (like copy_icudtl_dat#host).
84 'toolsets': [ 'host' ],
86 'destination': '<(PRODUCT_DIR)',
92 } , { # else: OS != android
94 'source/data/in/icudtl.dat',
101 'target_name': 'icudata',
102 'type': 'static_library',
104 'U_HIDE_DATA_SYMBOL',
107 # These are hand-generated, but will do for now. The linux
108 # version is an identical copy of the (mac) icudtl_dat.S file,
109 # modulo removal of the .private_extern and .const directives and
110 # with no leading underscore on the icudt52_dat symbol.
111 'android/icudtl_dat.S',
112 'linux/icudtl_dat.S',
116 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
117 'toolsets': ['host'],
119 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
120 'toolsets': ['host', 'target'],
122 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
123 'toolsets': ['target'],
125 [ 'OS == "win" and icu_use_data_file_flag==0', {
129 'destination': '<(PRODUCT_DIR)',
136 [ 'icu_use_data_file_flag==1', {
137 # Remove any assembly data file.
138 'sources/': [['exclude', 'icudtl_dat']],
139 # Compile in the stub data symbol.
140 'sources': ['source/stubdata/stubdata.c'],
142 # Make sure any binary depending on this gets the data file.
146 'copy_icudtl_dat#host',
148 } , { # else: OS=="ios"
150 'mac_bundle_resources': [
151 'source/data/in/icudtl.dat',
156 }], # icu_use_data_file_flag
158 'target_conditions': [
159 [ 'OS == "win" or OS == "mac" or OS == "ios" or '
160 '(OS == "android" and (_toolset != "host" or host_os != "linux")) or '
161 '(OS == "qnx" and (_toolset == "host" and host_os != "linux"))', {
162 'sources!': ['linux/icudtl_dat.S'],
164 [ 'OS != "android" or _toolset == "host"', {
165 'sources!': ['android/icudtl_dat.S'],
167 [ 'OS != "mac" and OS != "ios" and '
168 '((OS != "android" and OS != "qnx") or '
169 '_toolset != "host" or host_os != "mac")', {
170 'sources!': ['mac/icudtl_dat.S'],
172 ], # target_conditions
175 'target_name': 'icui18n',
176 'type': '<(component)',
178 '<@(icui18n_sources)',
181 'U_I18N_IMPLEMENTATION',
186 'direct_dependent_settings': {
192 'clang_warning_flags': [
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 # Looks like a real issue, see http://crbug.com/114660
200 '-Wno-return-type-c-linkage',
203 # Since ICU wants to internally use its own deprecated APIs, don't
206 '-Wno-deprecated-declarations',
212 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
215 'VCCLCompilerTool': {
216 'RuntimeTypeInfo': 'true',
220 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
221 'toolsets': ['host'],
223 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
224 'toolsets': ['host', 'target'],
226 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
227 'toolsets': ['target'],
229 ['OS == "android" and clang==0', {
230 # Disable sincos() optimization to avoid a linker error since
231 # Android's math library doesn't have sincos(). Either
232 # -fno-builtin-sin or -fno-builtin-cos works.
237 [ 'OS == "win" and clang==1', {
238 # Note: General clang warnings should go in the
239 # clang_warning_flags block above.
241 'VCCLCompilerTool': {
242 'AdditionalOptions': [
243 # See http://bugs.icu-project.org/trac/ticket/11122
244 '-Wno-inline-new-delete',
245 '-Wno-implicit-exception-spec-mismatch',
253 'target_name': 'icuuc',
254 'type': '<(component)',
259 'U_COMMON_IMPLEMENTATION',
264 'direct_dependent_settings': {
269 [ 'component=="static_library"', {
271 'U_STATIC_IMPLEMENTATION',
277 'clang_warning_flags': [
278 # ICU uses its own deprecated functions.
279 '-Wno-deprecated-declarations',
280 # ICU prefers `a && b || c` over `(a && b) || c`.
281 '-Wno-logical-op-parentheses',
282 # ICU has some `unsigned < 0` checks.
283 '-Wno-tautological-compare',
284 # uresdata.c has switch(RES_GET_TYPE(x)) code. The
285 # RES_GET_TYPE macro returns an UResType enum, but some switch
286 # statement contains case values that aren't part of that
287 # enum (e.g. URES_TABLE32 which is in UResInternalType). This
293 # Since ICU wants to internally use its own deprecated APIs,
294 # don't complain about it.
295 '-Wno-deprecated-declarations',
296 '-Wno-unused-function',
302 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
305 'VCCLCompilerTool': {
306 'RuntimeTypeInfo': 'true',
309 'all_dependent_settings': {
312 'AdditionalDependencies': [
319 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
320 'toolsets': ['host'],
322 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
323 'toolsets': ['host', 'target'],
325 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
326 'toolsets': ['target'],
328 [ 'OS == "win" and icu_use_data_file_flag==0', {
330 'source/stubdata/stubdata.c',
333 [ 'OS == "win" and clang==1', {
334 # Note: General clang warnings should go in the
335 # clang_warning_flags block above.
337 'VCCLCompilerTool': {
338 'AdditionalOptions': [
339 # See http://bugs.icu-project.org/trac/ticket/11122
340 '-Wno-inline-new-delete',
341 '-Wno-implicit-exception-spec-mismatch',
350 ['use_system_icu==1', {
353 'target_name': 'system_icu',
367 '<!@(icu-config --ldflags)',
370 '<!@(icu-config --ldflags-libsonly)',
377 'target_name': 'icudata',
379 'dependencies': ['system_icu'],
380 'export_dependent_settings': ['system_icu'],
381 'toolsets': ['target'],
384 'target_name': 'icui18n',
386 'dependencies': ['system_icu'],
387 'export_dependent_settings': ['system_icu'],
389 'headers_root_path': 'source/i18n',
390 'header_filenames': [
391 # This list can easily be updated using the command below:
392 # find third_party/icu/source/i18n/unicode -iname '*.h' \
393 # -printf "'%p',\n" | \
394 # sed -e 's|third_party/icu/source/i18n/||' | sort -u
395 'unicode/alphaindex.h',
397 'unicode/calendar.h',
398 'unicode/choicfmt.h',
401 'unicode/compactdecimalformat.h',
403 'unicode/currpinf.h',
404 'unicode/currunit.h',
406 'unicode/dcfmtsym.h',
407 'unicode/decimfmt.h',
408 'unicode/dtfmtsym.h',
409 'unicode/dtitvfmt.h',
410 'unicode/dtitvinf.h',
411 'unicode/dtptngen.h',
413 'unicode/fieldpos.h',
416 'unicode/fpositer.h',
418 'unicode/gregocal.h',
419 'unicode/locdspnm.h',
421 'unicode/measunit.h',
427 'unicode/plurrule.h',
434 'unicode/simpletz.h',
435 'unicode/smpdtfmt.h',
437 'unicode/stsearch.h',
439 'unicode/timezone.h',
443 'unicode/translit.h',
449 'unicode/ucoleitr.h',
453 'unicode/udateintervalformat.h',
456 'unicode/udisplaycontext.h',
457 'unicode/uformattable.h',
459 'unicode/uldnames.h',
460 'unicode/ulocdata.h',
465 'unicode/upluralrules.h',
470 'unicode/utmscale.h',
476 '../../build/shim_headers.gypi',
478 'toolsets': ['target'],
481 'target_name': 'icuuc',
483 'dependencies': ['system_icu'],
484 'export_dependent_settings': ['system_icu'],
486 'headers_root_path': 'source/common',
487 'header_filenames': [
488 # This list can easily be updated using the command below:
489 # find third_party/icu/source/common/unicode -iname '*.h' \
490 # -printf "'%p',\n" | \
491 # sed -e 's|third_party/icu/source/common/||' | sort -u
492 'unicode/appendable.h',
494 'unicode/bytestream.h',
495 'unicode/bytestriebuilder.h',
496 'unicode/bytestrie.h',
498 'unicode/chariter.h',
503 'unicode/errorcode.h',
504 'unicode/icudataver.h',
507 'unicode/listformatter.h',
508 'unicode/localpointer.h',
510 'unicode/messagepattern.h',
511 'unicode/normalizer2.h',
513 'unicode/parseerr.h',
514 'unicode/parsepos.h',
515 'unicode/platform.h',
521 'unicode/schriter.h',
522 'unicode/std_string.h',
524 'unicode/stringpiece.h',
525 'unicode/stringtriebuilder.h',
526 'unicode/symtable.h',
529 'unicode/ucasemap.h',
532 'unicode/ucharstriebuilder.h',
533 'unicode/ucharstrie.h',
534 'unicode/uchriter.h',
537 'unicode/ucnv_err.h',
546 'unicode/umachine.h',
549 'unicode/unifunct.h',
550 'unicode/unimatch.h',
561 'unicode/usetiter.h',
565 'unicode/ustringtrie.h',
575 'unicode/uversion.h',
579 '../../build/shim_headers.gypi',
581 'toolsets': ['target'],