From ea4dc7d44425aba111105c00ced031f680a65820 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 5 Nov 2014 19:09:43 -0800 Subject: [PATCH] build: i18n: fix icu toolset dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. PR-URL: https://github.com/joyent/node/pull/8681 Reviewed-by: Trevor Norris --- tools/icu/icu-generic.gyp | 62 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp index ef3d827df13..220d2c16a66 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -93,7 +93,7 @@ { 'target_name': 'icui18n', 'type': '<(library)', - 'toolsets': [ 'host', 'target' ], + 'toolsets': [ 'target' ], 'sources': [ '<@(icu_src_i18n)' ], @@ -111,28 +111,6 @@ }, 'export_dependent_settings': [ 'icuucx' ], }, - # this library is only built for derb.. - { - 'target_name': 'icuio', - 'type': '<(library)', - 'toolsets': [ 'host' ], - 'sources': [ - '<@(icu_src_io)' - ], - 'include_dirs': [ - '../../deps/icu/source/io', - ], - 'defines': [ - 'U_IO_IMPLEMENTATION=1', - ], - 'dependencies': [ 'icuucx', 'icui18n', 'icu_implementation', 'icu_uconfig' ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../../deps/icu/source/io', - ], - }, - 'export_dependent_settings': [ 'icuucx', 'icui18n' ], - }, # This exports actual ICU data { 'target_name': 'icudata', @@ -291,7 +269,7 @@ { 'target_name': 'icustubdata', 'type': '<(library)', - 'toolsets': [ 'host', 'target' ], + 'toolsets': [ 'target' ], 'dependencies': [ 'icu_implementation' ], 'sources': [ '<@(icu_src_stubdata)' @@ -316,7 +294,7 @@ 'target_name': 'icuucx', 'type': '<(library)', 'dependencies': [ 'icu_implementation', 'icu_uconfig' ], - 'toolsets': [ 'host', 'target' ], + 'toolsets': [ 'target' ], 'sources': [ '<@(icu_src_common)' ], @@ -345,23 +323,43 @@ 'target_name': 'icutools', 'type': '<(library)', 'toolsets': [ 'host' ], - 'dependencies': [ 'icuucx', 'icui18n', 'icustubdata' ], + 'dependencies': [ 'icu_implementation', 'icu_uconfig' ], 'sources': [ - '<@(icu_src_tools)' + '<@(icu_src_tools)', + '<@(icu_src_common)', + '<@(icu_src_i18n)', + '<@(icu_src_io)', + '<@(icu_src_stubdata)', ], 'include_dirs': [ + '../../deps/icu/source/common', + '../../deps/icu/source/i18n', + '../../deps/icu/source/io', '../../deps/icu/source/tools/toolutil', ], 'defines': [ + 'U_COMMON_IMPLEMENTATION=1', + 'U_I18N_IMPLEMENTATION=1', + 'U_IO_IMPLEMENTATION=1', 'U_TOOLUTIL_IMPLEMENTATION=1', #'DEBUG=0', # http://bugs.icu-project.org/trac/ticket/10977 ], 'direct_dependent_settings': { 'include_dirs': [ + '../../deps/icu/source/common', + '../../deps/icu/source/i18n', + '../../deps/icu/source/io', '../../deps/icu/source/tools/toolutil', ], + 'conditions': [ + [ 'OS=="win"', { + 'link_settings': { + 'libraries': [ '-lAdvAPI32.Lib', '-lUser32.lib' ], + }, + }], + ], }, - 'export_dependent_settings': [ 'icuucx', 'icui18n', 'icustubdata' ], + 'export_dependent_settings': [ 'icu_implementation', 'icu_uconfig' ], }, # This tool is needed to rebuild .res files from .txt, # or to build index (res_index.txt) files for small-icu @@ -369,7 +367,7 @@ 'target_name': 'genrb', 'type': 'executable', 'toolsets': [ 'host' ], - 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ], + 'dependencies': [ 'icutools' ], 'sources': [ '<@(icu_src_genrb)' ], @@ -385,7 +383,7 @@ 'target_name': 'iculslocs', 'toolsets': [ 'host' ], 'type': 'executable', - 'dependencies': [ 'icutools', 'icuucx', 'icui18n', 'icuio' ], + 'dependencies': [ 'icutools' ], 'sources': [ 'iculslocs.cc', 'no-op.cc', @@ -397,7 +395,7 @@ 'target_name': 'icupkg', 'toolsets': [ 'host' ], 'type': 'executable', - 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ], + 'dependencies': [ 'icutools' ], 'sources': [ '<@(icu_src_icupkg)', 'no-op.cc', @@ -408,7 +406,7 @@ 'target_name': 'genccode', 'toolsets': [ 'host' ], 'type': 'executable', - 'dependencies': [ 'icutools', 'icuucx', 'icui18n' ], + 'dependencies': [ 'icutools' ], 'sources': [ '<@(icu_src_genccode)', 'no-op.cc',