Correct gyp toolsets for all combinations of want_separate_host_toolset and use_system_icu.

This CL ensures following logics:
if want_separate_host_toolset == 0 and use_system_icu == 0
  don't use system icu
  build icu for target toolset

elif want_separate_host_toolset == 0 and use_system_icu == 1
  use system icu for target toolset
  don't build icu

elif want_separate_host_toolset == 1 and use_system_icu == 0
  don't use system icu
  build icu for host and target

elif want_separate_host_toolset == 1 and use_system_icu == 1
  use system icu for target toolset
  build icu for host toolset

All complexity is due to the condition: want_separate_host_toolset == 1 and use_system_icu == 1.
Although use_system_icu == 1, this condition requires to build icu for host toolset.

BUG=
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/124003004

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu46@244134 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/icu.gyp b/icu.gyp
index 38d2939..4900ab2 100644
--- a/icu.gyp
+++ b/icu.gyp
@@ -69,11 +69,15 @@
              'mac/icudt46l_dat.S',
           ],
           'conditions': [
-            [ 'use_system_icu==1', {
+            [ 'use_system_icu==1 and want_separate_host_toolset==1', {
               'toolsets': ['host'],
-            }, {
+            }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==1', {
               'toolsets': ['host', 'target'],
             }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==0', {
+              'toolsets': ['target'],
+            }],
             [ 'OS == "win" and icu_use_data_file_flag==0', {
               'type': 'none',
               'copies': [
@@ -122,7 +126,7 @@
               '(OS != "android" or _toolset != "host" or host_os != "mac")', {
               'sources!': ['mac/icudt46l_dat.S'],
             }],
-          ],
+          ], # target_conditions
         },
         {
           'target_name': 'icui18n',
@@ -142,11 +146,15 @@
             ],
           },
           'conditions': [
-            [ 'use_system_icu==1', {
+            [ 'use_system_icu==1 and want_separate_host_toolset==1', {
               'toolsets': ['host'],
-            }, {
+            }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==1', {
               'toolsets': ['host', 'target'],
             }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==0', {
+              'toolsets': ['target'],
+            }],
             [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
               # Since ICU wants to internally use its own deprecated APIs, don't
               # complain about it.
@@ -218,7 +226,7 @@
                 }],
               ],
             }],
-          ],
+          ], # conditions
         },
         {
           'target_name': 'icuuc',
@@ -245,11 +253,15 @@
             ],
           },
           'conditions': [
-            [ 'use_system_icu==1', {
+            [ 'use_system_icu==1 and want_separate_host_toolset==1', {
               'toolsets': ['host'],
-            }, {
+            }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==1', {
               'toolsets': ['host', 'target'],
             }],
+            [ 'use_system_icu==0 and want_separate_host_toolset==0', {
+              'toolsets': ['target'],
+            }],
             [ 'OS == "win"', {
               'sources': [
                 'source/stubdata/stubdata.c',
@@ -318,9 +330,9 @@
                 '-Wno-switch',
               ],
             }],
-          ],
+          ], # conditions
         },
-      ],
+      ], # targets
     }],
     ['use_system_icu==1', {
       'targets': [
@@ -328,11 +340,6 @@
           'target_name': 'system_icu',
           'type': 'none',
           'conditions': [
-            ['want_separate_host_toolset==1', {
-              'toolsets': ['target'],
-            }, {
-              'toolsets': ['host', 'target'],
-            }],
             ['OS=="android"', {
               'direct_dependent_settings': {
                 'include_dirs': [
@@ -363,13 +370,7 @@
           'type': 'none',
           'dependencies': ['system_icu'],
           'export_dependent_settings': ['system_icu'],
-          'conditions': [
-            ['want_separate_host_toolset==1', {
-              'toolsets': ['target'],
-            }, {
-              'toolsets': ['host', 'target'],
-            }],
-          ],
+          'toolsets': ['target'],
         },
         {
           'target_name': 'icui18n',
@@ -456,13 +457,7 @@
           'includes': [
             '../../build/shim_headers.gypi',
           ],
-          'conditions': [
-            ['want_separate_host_toolset==1', {
-              'toolsets': ['target'],
-            }, {
-              'toolsets': ['host', 'target'],
-            }],
-          ],
+          'toolsets': ['target'],
         },
         {
           'target_name': 'icuuc',
@@ -567,15 +562,9 @@
           'includes': [
             '../../build/shim_headers.gypi',
           ],
-          'conditions': [
-            ['want_separate_host_toolset==1', {
-              'toolsets': ['target'],
-            }, {
-              'toolsets': ['host', 'target'],
-            }],
-          ],
+          'toolsets': ['target'],
         },
-      ],
+      ], # targets
     }],
-  ],
+  ], # conditions
 }