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',
30 ['component=="static_library"', {
32 'U_STATIC_IMPLEMENTATION',
35 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
36 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
37 (target_arch=="arm" or target_arch=="ia32" or \
38 target_arch=="mipsel")', {
39 'target_conditions': [
40 ['_toolset=="host"', {
42 'ldflags': [ '-m32' ],
50 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
51 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
52 (target_arch=="arm64" or target_arch=="x64" or \
53 target_arch=="mipsel64")', {
54 'target_conditions': [
55 ['_toolset=="host"', {
57 'ldflags': [ '-m64' ],
60 'ARCHS': [ 'x86_64' ],
70 'msvs_disabled_warnings': [4005, 4068, 4355, 4996, 4267],
73 ['use_system_icu==0 or want_separate_host_toolset==1', {
76 'target_name': 'copy_icudtl_dat',
78 # icudtl.dat is the same for both host/target, so this only supports a
79 # single toolset. If a target requires that the .dat file be copied
80 # to the output directory, it should explicitly depend on this target
81 # with the host toolset (like copy_icudtl_dat#host).
82 'toolsets': [ 'host' ],
84 'destination': '<(PRODUCT_DIR)',
90 } , { # else: OS != android
92 'source/data/in/icudtl.dat',
99 'target_name': 'icudata',
100 'type': 'static_library',
102 'U_HIDE_DATA_SYMBOL',
105 # These are hand-generated, but will do for now. The linux
106 # version is an identical copy of the (mac) icudtl_dat.S file,
107 # modulo removal of the .private_extern and .const directives and
108 # with no leading underscore on the icudt52_dat symbol.
109 'android/icudtl_dat.S',
110 'linux/icudtl_dat.S',
114 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
115 'toolsets': ['host'],
117 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
118 'toolsets': ['host', 'target'],
120 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
121 'toolsets': ['target'],
123 [ 'OS == "win" and icu_use_data_file_flag==0', {
127 'destination': '<(PRODUCT_DIR)',
134 [ 'icu_use_data_file_flag==1', {
135 # Remove any assembly data file.
136 'sources/': [['exclude', 'icudtl_dat']],
137 # Compile in the stub data symbol.
138 'sources': ['source/stubdata/stubdata.c'],
140 # Make sure any binary depending on this gets the data file.
144 'copy_icudtl_dat#host',
146 } , { # else: OS=="ios"
148 'mac_bundle_resources': [
149 'source/data/in/icudtl.dat',
154 }], # icu_use_data_file_flag
156 'target_conditions': [
157 [ 'OS == "win" or OS == "mac" or OS == "ios" or '
158 '(OS == "android" and (_toolset != "host" or host_os != "linux")) or '
159 '(OS == "qnx" and (_toolset == "host" and host_os != "linux"))', {
160 'sources!': ['linux/icudtl_dat.S'],
162 [ 'OS != "android" or _toolset == "host"', {
163 'sources!': ['android/icudtl_dat.S'],
165 [ 'OS != "mac" and OS != "ios" and '
166 '((OS != "android" and OS != "qnx") or '
167 '_toolset != "host" or host_os != "mac")', {
168 'sources!': ['mac/icudtl_dat.S'],
170 ], # target_conditions
173 'target_name': 'icui18n',
174 'type': '<(component)',
176 '<@(icui18n_sources)',
179 'U_I18N_IMPLEMENTATION',
184 'direct_dependent_settings': {
190 'clang_warning_flags': [
191 # ICU uses its own deprecated functions.
192 '-Wno-deprecated-declarations',
193 # ICU prefers `a && b || c` over `(a && b) || c`.
194 '-Wno-logical-op-parentheses',
195 # ICU has some `unsigned < 0` checks.
196 '-Wno-tautological-compare',
197 # Looks like a real issue, see http://crbug.com/114660
198 '-Wno-return-type-c-linkage',
201 # Since ICU wants to internally use its own deprecated APIs, don't
204 '-Wno-deprecated-declarations',
210 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
213 'VCCLCompilerTool': {
214 'RuntimeTypeInfo': 'true',
218 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
219 'toolsets': ['host'],
221 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
222 'toolsets': ['host', 'target'],
224 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
225 'toolsets': ['target'],
227 ['OS == "android" and clang==0', {
228 # Disable sincos() optimization to avoid a linker error since
229 # Android's math library doesn't have sincos(). Either
230 # -fno-builtin-sin or -fno-builtin-cos works.
235 [ 'OS == "win" and clang==1', {
236 # Note: General clang warnings should go in the
237 # clang_warning_flags block above.
239 'VCCLCompilerTool': {
240 'AdditionalOptions': [
241 # See http://bugs.icu-project.org/trac/ticket/11122
242 '-Wno-inline-new-delete',
243 '-Wno-implicit-exception-spec-mismatch',
248 ['OS == "android" and use_system_stlport == 1', {
249 'target_conditions': [
250 ['_toolset == "target"', {
251 # ICU requires RTTI, which is not present in the system's
252 # stlport, so we have to include gabi++.
254 '<(android_src)/abi/cpp/include',
262 'target_name': 'icuuc',
263 'type': '<(component)',
268 'U_COMMON_IMPLEMENTATION',
273 'direct_dependent_settings': {
278 [ 'component=="static_library"', {
280 'U_STATIC_IMPLEMENTATION',
286 'clang_warning_flags': [
287 # ICU uses its own deprecated functions.
288 '-Wno-deprecated-declarations',
289 # ICU prefers `a && b || c` over `(a && b) || c`.
290 '-Wno-logical-op-parentheses',
291 # ICU has some `unsigned < 0` checks.
292 '-Wno-tautological-compare',
293 # uresdata.c has switch(RES_GET_TYPE(x)) code. The
294 # RES_GET_TYPE macro returns an UResType enum, but some switch
295 # statement contains case values that aren't part of that
296 # enum (e.g. URES_TABLE32 which is in UResInternalType). This
302 # Since ICU wants to internally use its own deprecated APIs,
303 # don't complain about it.
304 '-Wno-deprecated-declarations',
305 '-Wno-unused-function',
311 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
314 'VCCLCompilerTool': {
315 'RuntimeTypeInfo': 'true',
318 'all_dependent_settings': {
321 'AdditionalDependencies': [
328 [ 'use_system_icu==1 and want_separate_host_toolset==1', {
329 'toolsets': ['host'],
331 [ 'use_system_icu==0 and want_separate_host_toolset==1', {
332 'toolsets': ['host', 'target'],
334 [ 'use_system_icu==0 and want_separate_host_toolset==0', {
335 'toolsets': ['target'],
337 [ 'OS == "win" and icu_use_data_file_flag==0', {
339 'source/stubdata/stubdata.c',
342 [ 'OS == "win" and clang==1', {
343 # Note: General clang warnings should go in the
344 # clang_warning_flags block above.
346 'VCCLCompilerTool': {
347 'AdditionalOptions': [
348 # See http://bugs.icu-project.org/trac/ticket/11122
349 '-Wno-inline-new-delete',
350 '-Wno-implicit-exception-spec-mismatch',
355 ['OS == "android" and use_system_stlport == 1', {
356 'target_conditions': [
357 ['_toolset == "target"', {
358 # ICU requires RTTI, which is not present in the system's
359 # stlport, so we have to include gabi++.
361 '<(android_src)/abi/cpp/include',
370 ['use_system_icu==1', {
373 'target_name': 'system_icu',
377 'direct_dependent_settings': {
379 '<(android_src)/external/icu/icu4c/source/common',
380 '<(android_src)/external/icu/icu4c/source/i18n',
398 ['OS!="android" and OS!="qnx"', {
401 '<!@(icu-config --ldflags)',
404 '<!@(icu-config --ldflags-libsonly)',
411 'target_name': 'icudata',
413 'dependencies': ['system_icu'],
414 'export_dependent_settings': ['system_icu'],
415 'toolsets': ['target'],
418 'target_name': 'icui18n',
420 'dependencies': ['system_icu'],
421 'export_dependent_settings': ['system_icu'],
423 'headers_root_path': 'source/i18n',
424 'header_filenames': [
425 # This list can easily be updated using the command below:
426 # find third_party/icu/source/i18n/unicode -iname '*.h' \
427 # -printf "'%p',\n" | \
428 # sed -e 's|third_party/icu/source/i18n/||' | sort -u
429 'unicode/alphaindex.h',
431 'unicode/calendar.h',
432 'unicode/choicfmt.h',
435 'unicode/compactdecimalformat.h',
437 'unicode/currpinf.h',
438 'unicode/currunit.h',
440 'unicode/dcfmtsym.h',
441 'unicode/decimfmt.h',
442 'unicode/dtfmtsym.h',
443 'unicode/dtitvfmt.h',
444 'unicode/dtitvinf.h',
445 'unicode/dtptngen.h',
447 'unicode/fieldpos.h',
450 'unicode/fpositer.h',
452 'unicode/gregocal.h',
453 'unicode/locdspnm.h',
455 'unicode/measunit.h',
461 'unicode/plurrule.h',
468 'unicode/simpletz.h',
469 'unicode/smpdtfmt.h',
471 'unicode/stsearch.h',
473 'unicode/timezone.h',
477 'unicode/translit.h',
483 'unicode/ucoleitr.h',
487 'unicode/udateintervalformat.h',
490 'unicode/udisplaycontext.h',
491 'unicode/uformattable.h',
493 'unicode/uldnames.h',
494 'unicode/ulocdata.h',
499 'unicode/upluralrules.h',
504 'unicode/utmscale.h',
510 '../../build/shim_headers.gypi',
512 'toolsets': ['target'],
515 'target_name': 'icuuc',
517 'dependencies': ['system_icu'],
518 'export_dependent_settings': ['system_icu'],
520 'headers_root_path': 'source/common',
521 'header_filenames': [
522 # This list can easily be updated using the command below:
523 # find third_party/icu/source/common/unicode -iname '*.h' \
524 # -printf "'%p',\n" | \
525 # sed -e 's|third_party/icu/source/common/||' | sort -u
526 'unicode/appendable.h',
528 'unicode/bytestream.h',
529 'unicode/bytestriebuilder.h',
530 'unicode/bytestrie.h',
532 'unicode/chariter.h',
537 'unicode/errorcode.h',
538 'unicode/icudataver.h',
541 'unicode/listformatter.h',
542 'unicode/localpointer.h',
544 'unicode/messagepattern.h',
545 'unicode/normalizer2.h',
547 'unicode/parseerr.h',
548 'unicode/parsepos.h',
549 'unicode/platform.h',
555 'unicode/schriter.h',
556 'unicode/std_string.h',
558 'unicode/stringpiece.h',
559 'unicode/stringtriebuilder.h',
560 'unicode/symtable.h',
563 'unicode/ucasemap.h',
566 'unicode/ucharstriebuilder.h',
567 'unicode/ucharstrie.h',
568 'unicode/uchriter.h',
571 'unicode/ucnv_err.h',
580 'unicode/umachine.h',
583 'unicode/unifunct.h',
584 'unicode/unimatch.h',
595 'unicode/usetiter.h',
599 'unicode/ustringtrie.h',
609 'unicode/uversion.h',
613 '../../build/shim_headers.gypi',
615 'toolsets': ['target'],