Revision: 23522
Author:   [email protected]
Date:     Fri Aug 29 15:04:59 2014 UTC
Log: Properly separate host and target builds when using external natives.

[email protected], [email protected]

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

Patch from AndrĂ© Baixo <[email protected]>.
https://code.google.com/p/v8/source/detail?r=23522

Modified:
 /branches/bleeding_edge/tools/gyp/v8.gyp

=======================================
--- /branches/bleeding_edge/tools/gyp/v8.gyp    Fri Aug 29 12:30:50 2014 UTC
+++ /branches/bleeding_edge/tools/gyp/v8.gyp    Fri Aug 29 15:04:59 2014 UTC
@@ -55,12 +55,23 @@
           # to appear before libv8_snapshot.a so it's listed explicitly.
           'dependencies': ['v8_base', 'v8_nosnapshot'],
         }],
- ['v8_use_external_startup_data==1 and want_separate_host_toolset==0', { + ['v8_use_external_startup_data==1 and want_separate_host_toolset==1', {
           'dependencies': ['v8_base', 'v8_external_snapshot'],
+          'target_conditions': [
+            ['_toolset=="host"', {
+              'inputs': [
+                '<(PRODUCT_DIR)/snapshot_blob_host.bin',
+              ],
+            }, {
+              'inputs': [
+                '<(PRODUCT_DIR)/snapshot_blob.bin',
+              ],
+            }],
+          ],
         }],
- ['v8_use_external_startup_data==1 and want_separate_host_toolset==1', {
-          'dependencies': ['v8_base', 'v8_external_snapshot#host'],
-        }],
+ ['v8_use_external_startup_data==1 and want_separate_host_toolset==0', {
+          'dependencies': ['v8_base', 'v8_external_snapshot'],
+          'inputs': [ '<(PRODUCT_DIR)/snapshot_blob.bin', ],
         ['component=="shared_library"', {
           'type': '<(component)',
           'sources': [
@@ -218,11 +229,11 @@
       'type': 'static_library',
       'conditions': [
         ['want_separate_host_toolset==1', {
-          'toolsets': ['host'],
+          'toolsets': ['host', 'target'],
           'dependencies': [
             'mksnapshot#host',
             'js2c#host',
-            'natives_blob#host',
+            'natives_blob',
         ]}, {
           'toolsets': ['target'],
           'dependencies': [
@@ -260,9 +271,27 @@
           'inputs': [
             
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
           ],
-          'outputs': [
-            '<(INTERMEDIATE_DIR)/snapshot.cc',
-            '<(PRODUCT_DIR)/snapshot_blob.bin',
+          'conditions': [
+            ['want_separate_host_toolset==1', {
+              'target_conditions': [
+                ['_toolset=="host"', {
+                  'outputs': [
+                    '<(INTERMEDIATE_DIR)/snapshot.cc',
+                    '<(PRODUCT_DIR)/snapshot_blob_host.bin',
+                  ],
+                }, {
+                  'outputs': [
+                    '<(INTERMEDIATE_DIR)/snapshot.cc',
+                    '<(PRODUCT_DIR)/snapshot_blob.bin',
+                  ],
+                }],
+              ],
+            }, {
+              'outputs': [
+                '<(INTERMEDIATE_DIR)/snapshot.cc',
+                '<(PRODUCT_DIR)/snapshot_blob.bin',
+              ],
+            }],
           ],
           'variables': {
             'mksnapshot_flags': [
@@ -1398,7 +1427,13 @@
       'type': 'none',
       'conditions': [
         [ 'v8_use_external_startup_data==1', {
-          'dependencies': ['js2c'],
+          'conditions': [
+            ['want_separate_host_toolset==1', {
+              'dependencies': ['js2c#host'],
+            }, {
+              'dependencies': ['js2c'],
+            }],
+          ],
           'actions': [{
             'action_name': 'concatenate_natives_blob',
             'inputs': [
@@ -1406,14 +1441,38 @@
               '<(SHARED_INTERMEDIATE_DIR)/libraries.bin',
               '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin',
             ],
-            'outputs': [
-              '<(PRODUCT_DIR)/natives_blob.bin',
+            'conditions': [
+              ['want_separate_host_toolset==1', {
+                'target_conditions': [
+                  ['_toolset=="host"', {
+                    'outputs': [
+                      '<(PRODUCT_DIR)/natives_blob_host.bin',
+                    ],
+                    'action': [
+                      'python', '<@(_inputs)', 
'<(PRODUCT_DIR)/natives_blob_host.bin'
+                    ],
+                  }, {
+                    'outputs': [
+                      '<(PRODUCT_DIR)/natives_blob.bin',
+                    ],
+                    'action': [
+                      'python', '<@(_inputs)', 
'<(PRODUCT_DIR)/natives_blob.bin'
+                    ],
+                  }],
+                ],
+              }, {
+                'outputs': [
+                  '<(PRODUCT_DIR)/natives_blob.bin',
+                ],
+                'action': [
+                  'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob.bin'
+                ],
+              }],
             ],
-            'action': ['python', '<@(_inputs)', '<@(_outputs)'],
           }],
         }],
         ['want_separate_host_toolset==1', {
-          'toolsets': ['host'],
+          'toolsets': ['host', 'target'],
         }, {
           'toolsets': ['target'],
         }],

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to