Skip to content

Commit 8684549

Browse files
authored
fix: only build embedded.cc when under Windows. (#11)
1 parent 12c055a commit 8684549

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tools/v8_gypfiles/v8.gyp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,14 @@
407407
'<(mksnapshot_exec)',
408408
],
409409
'outputs': [
410-
'<(INTERMEDIATE_DIR)/snapshot.cc',
410+
# snapshot.cc is always built in the 'asm_to_inline_asm' step.
411411
'<(INTERMEDIATE_DIR)/embedded.S',
412412
],
413413
'conditions': [
414+
# When not under Windows, embedded.S will be compiled directly.
415+
['OS != "win"', {
416+
'process_outputs_as_sources': 1,
417+
}],
414418
['v8_random_seed', {
415419
'variables': {
416420
'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
@@ -450,14 +454,27 @@
450454
],
451455
},
452456
{
457+
# This action is only useful on Windows.
458+
# Under non-Windows systems, we effectively ignore
459+
# the output of this action.
453460
'action_name': 'asm_to_inline_asm',
454461
'message': 'generating: >@(_outputs)',
455462
'inputs': [
456463
'<(INTERMEDIATE_DIR)/embedded.S',
457464
],
458-
'outputs': [
465+
'conditions': [
466+
# Under Windows, we need to generate snapshot.cc and embedded.cc.
467+
['OS == "win"', {
468+
'outputs': [
459469
'<(INTERMEDIATE_DIR)/snapshot.cc',
460470
'<(INTERMEDIATE_DIR)/embedded.cc',
471+
],
472+
}],
473+
# Under non-Windows systems, we effectively ignore the output of this
474+
# action. We do need to build snapshot.cc, however.
475+
['OS != "win"', {
476+
'outputs': ['<(INTERMEDIATE_DIR)/snapshot.cc']
477+
}],
461478
],
462479
'process_outputs_as_sources': 1,
463480
'action': [

0 commit comments

Comments
 (0)