From 86845490ecfc0484cff23e749ff03d75f463ce24 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Fri, 5 Jan 2024 00:21:00 -0500 Subject: [PATCH] fix: only build embedded.cc when under Windows. (#11) --- tools/v8_gypfiles/v8.gyp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 46258149b630f8..699653f4505d8d 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -407,10 +407,14 @@ '<(mksnapshot_exec)', ], 'outputs': [ - '<(INTERMEDIATE_DIR)/snapshot.cc', + # snapshot.cc is always built in the 'asm_to_inline_asm' step. '<(INTERMEDIATE_DIR)/embedded.S', ], 'conditions': [ + # When not under Windows, embedded.S will be compiled directly. + ['OS != "win"', { + 'process_outputs_as_sources': 1, + }], ['v8_random_seed', { 'variables': { 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], @@ -450,14 +454,27 @@ ], }, { + # This action is only useful on Windows. + # Under non-Windows systems, we effectively ignore + # the output of this action. 'action_name': 'asm_to_inline_asm', 'message': 'generating: >@(_outputs)', 'inputs': [ '<(INTERMEDIATE_DIR)/embedded.S', ], - 'outputs': [ + 'conditions': [ + # Under Windows, we need to generate snapshot.cc and embedded.cc. + ['OS == "win"', { + 'outputs': [ '<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/embedded.cc', + ], + }], + # Under non-Windows systems, we effectively ignore the output of this + # action. We do need to build snapshot.cc, however. + ['OS != "win"', { + 'outputs': ['<(INTERMEDIATE_DIR)/snapshot.cc'] + }], ], 'process_outputs_as_sources': 1, 'action': [