Properly separate host and target builds when using external natives.

R=rmcilroy@chromium.org, vogelheim@chromium.org

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

Patch from André Baixo <baixo@google.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
rmcilroy@chromium.org 2014-08-29 15:04:59 +00:00
parent 1047a48c0c
commit 1e14742ed2

View File

@ -55,12 +55,23 @@
# to appear before libv8_snapshot.a so it's listed explicitly. # to appear before libv8_snapshot.a so it's listed explicitly.
'dependencies': ['v8_base', 'v8_nosnapshot'], 'dependencies': ['v8_base', 'v8_nosnapshot'],
}], }],
['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==0', { ['v8_use_external_startup_data==1 and want_separate_host_toolset==0', {
'dependencies': ['v8_base', 'v8_external_snapshot'], 'dependencies': ['v8_base', 'v8_external_snapshot'],
}], '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'],
}],
['component=="shared_library"', { ['component=="shared_library"', {
'type': '<(component)', 'type': '<(component)',
'sources': [ 'sources': [
@ -218,11 +229,11 @@
'type': 'static_library', 'type': 'static_library',
'conditions': [ 'conditions': [
['want_separate_host_toolset==1', { ['want_separate_host_toolset==1', {
'toolsets': ['host'], 'toolsets': ['host', 'target'],
'dependencies': [ 'dependencies': [
'mksnapshot#host', 'mksnapshot#host',
'js2c#host', 'js2c#host',
'natives_blob#host', 'natives_blob',
]}, { ]}, {
'toolsets': ['target'], 'toolsets': ['target'],
'dependencies': [ 'dependencies': [
@ -260,9 +271,27 @@
'inputs': [ 'inputs': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
], ],
'outputs': [ 'conditions': [
'<(INTERMEDIATE_DIR)/snapshot.cc', ['want_separate_host_toolset==1', {
'<(PRODUCT_DIR)/snapshot_blob.bin', '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': { 'variables': {
'mksnapshot_flags': [ 'mksnapshot_flags': [
@ -1398,7 +1427,13 @@
'type': 'none', 'type': 'none',
'conditions': [ 'conditions': [
[ 'v8_use_external_startup_data==1', { [ 'v8_use_external_startup_data==1', {
'dependencies': ['js2c'], 'conditions': [
['want_separate_host_toolset==1', {
'dependencies': ['js2c#host'],
}, {
'dependencies': ['js2c'],
}],
],
'actions': [{ 'actions': [{
'action_name': 'concatenate_natives_blob', 'action_name': 'concatenate_natives_blob',
'inputs': [ 'inputs': [
@ -1406,14 +1441,38 @@
'<(SHARED_INTERMEDIATE_DIR)/libraries.bin', '<(SHARED_INTERMEDIATE_DIR)/libraries.bin',
'<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin', '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental.bin',
], ],
'outputs': [ 'conditions': [
'<(PRODUCT_DIR)/natives_blob.bin', ['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', { ['want_separate_host_toolset==1', {
'toolsets': ['host'], 'toolsets': ['host', 'target'],
}, { }, {
'toolsets': ['target'], 'toolsets': ['target'],
}], }],