Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 658e8ae

Browse files
committed
build: i18n: fix issue with icu toolset dependencies
So what I did here is to make the `icutools` library actually contain the entire ICU dependencies needed for host-side tools. Sadly, this will build ICU twice, but avoids conflicts between host and target side. This all seems like a gyp bug of some sort, but without docs for `toolsets`, who’s to say? I removed the `icuio` library as a separate target, because it was only used by the host-side tools. ref: #7676 Update: fix for Windows
1 parent fd22268 commit 658e8ae

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

tools/icu/icu-generic.gyp

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
{
9191
'target_name': 'icui18n',
9292
'type': '<(library)',
93-
'toolsets': [ 'host', 'target' ],
93+
'toolsets': [ 'target' ],
9494
'sources': [
9595
'<@(icu_src_i18n)'
9696
],
@@ -108,28 +108,6 @@
108108
},
109109
'export_dependent_settings': [ 'icuucx' ],
110110
},
111-
# this library is only built for derb..
112-
{
113-
'target_name': 'icuio',
114-
'type': '<(library)',
115-
'toolsets': [ 'host' ],
116-
'sources': [
117-
'<@(icu_src_io)'
118-
],
119-
'include_dirs': [
120-
'../../deps/icu/source/io',
121-
],
122-
'defines': [
123-
'U_IO_IMPLEMENTATION=1',
124-
],
125-
'dependencies': [ 'icuucx', 'icui18n', 'icu_implementation', 'icu_uconfig' ],
126-
'direct_dependent_settings': {
127-
'include_dirs': [
128-
'../../deps/icu/source/io',
129-
],
130-
},
131-
'export_dependent_settings': [ 'icuucx', 'icui18n' ],
132-
},
133111
# This exports actual ICU data
134112
{
135113
'target_name': 'icudata',
@@ -288,7 +266,7 @@
288266
{
289267
'target_name': 'icustubdata',
290268
'type': '<(library)',
291-
'toolsets': [ 'host', 'target' ],
269+
'toolsets': [ 'target' ],
292270
'dependencies': [ 'icu_implementation' ],
293271
'sources': [
294272
'<@(icu_src_stubdata)'
@@ -313,7 +291,7 @@
313291
'target_name': 'icuucx',
314292
'type': '<(library)',
315293
'dependencies': [ 'icu_implementation', 'icu_uconfig' ],
316-
'toolsets': [ 'host', 'target' ],
294+
'toolsets': [ 'target' ],
317295
'sources': [
318296
'<@(icu_src_common)'
319297
],
@@ -342,31 +320,51 @@
342320
'target_name': 'icutools',
343321
'type': '<(library)',
344322
'toolsets': [ 'host' ],
345-
'dependencies': [ 'icuucx', 'icui18n', 'icustubdata' ],
323+
'dependencies': [ 'icu_implementation', 'icu_uconfig' ],
346324
'sources': [
347-
'<@(icu_src_tools)'
325+
'<@(icu_src_tools)',
326+
'<@(icu_src_common)',
327+
'<@(icu_src_i18n)',
328+
'<@(icu_src_io)',
329+
'<@(icu_src_stubdata)',
348330
],
349331
'include_dirs': [
332+
'../../deps/icu/source/common',
333+
'../../deps/icu/source/i18n',
334+
'../../deps/icu/source/io',
350335
'../../deps/icu/source/tools/toolutil',
351336
],
352337
'defines': [
338+
'U_COMMON_IMPLEMENTATION=1',
339+
'U_I18N_IMPLEMENTATION=1',
340+
'U_IO_IMPLEMENTATION=1',
353341
'U_TOOLUTIL_IMPLEMENTATION=1',
354342
#'DEBUG=0', # http://bugs.icu-project.org/trac/ticket/10977
355343
],
356344
'direct_dependent_settings': {
357345
'include_dirs': [
346+
'../../deps/icu/source/common',
347+
'../../deps/icu/source/i18n',
348+
'../../deps/icu/source/io',
358349
'../../deps/icu/source/tools/toolutil',
359350
],
351+
'conditions': [
352+
[ 'OS=="win"', {
353+
'link_settings': {
354+
'libraries': [ '-lAdvAPI32.Lib', '-lUser32.lib' ],
355+
},
356+
}],
357+
],
360358
},
361-
'export_dependent_settings': [ 'icuucx', 'icui18n', 'icustubdata' ],
359+
'export_dependent_settings': [ 'icu_implementation', 'icu_uconfig' ],
362360
},
363361
# This tool is needed to rebuild .res files from .txt,
364362
# or to build index (res_index.txt) files for small-icu
365363
{
366364
'target_name': 'genrb',
367365
'type': 'executable',
368366
'toolsets': [ 'host' ],
369-
'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
367+
'dependencies': [ 'icutools' ],
370368
'sources': [
371369
'<@(icu_src_genrb)'
372370
],
@@ -382,7 +380,7 @@
382380
'target_name': 'iculslocs',
383381
'toolsets': [ 'host' ],
384382
'type': 'executable',
385-
'dependencies': [ 'icutools', 'icuucx', 'icui18n', 'icuio' ],
383+
'dependencies': [ 'icutools' ],
386384
'sources': [
387385
'iculslocs.cc',
388386
'no-op.cc',
@@ -394,7 +392,7 @@
394392
'target_name': 'icupkg',
395393
'toolsets': [ 'host' ],
396394
'type': 'executable',
397-
'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
395+
'dependencies': [ 'icutools' ],
398396
'sources': [
399397
'<@(icu_src_icupkg)',
400398
'no-op.cc',
@@ -405,7 +403,7 @@
405403
'target_name': 'genccode',
406404
'toolsets': [ 'host' ],
407405
'type': 'executable',
408-
'dependencies': [ 'icutools', 'icuucx', 'icui18n' ],
406+
'dependencies': [ 'icutools' ],
409407
'sources': [
410408
'<@(icu_src_genccode)',
411409
'no-op.cc',

0 commit comments

Comments
 (0)