From d81151e100a77a3c80e2a065c6a37f16c385cece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 28 May 2023 14:01:50 +0200 Subject: [PATCH] tools: refactor v8_pch config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid repetition by defining a new GYP target. PR-URL: https://github.com/nodejs/node/pull/47364 Reviewed-By: Richard Lau Reviewed-By: Jiawen Geng Reviewed-By: Tobias Nießen --- tools/v8_gypfiles/v8.gyp | 71 +++++++++++++--------------------------- 1 file changed, 23 insertions(+), 48 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 6f04ec212b4804..f822c056e589f6 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -43,6 +43,23 @@ }, }, 'targets': [ + { + 'target_name': 'v8_pch', + 'type': 'none', + 'toolsets': ['host', 'target'], + 'conditions': [ + ['OS=="win"', { + 'direct_dependent_settings': { + 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', + 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', + 'sources': [ + '<(_msvs_precompiled_header)', + '<(_msvs_precompiled_source)', + ], + }, + }], + ], + }, # v8_pch { 'target_name': 'run_torque', 'type': 'none', @@ -244,6 +261,7 @@ 'torque_generated_initializers', 'v8_base_without_compiler', 'v8_shared_internal_headers', + 'v8_pch', ], 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', @@ -318,14 +336,6 @@ '<(V8_ROOT)/src/builtins/builtins-intl-gen.cc', ], }], - ['OS=="win"', { - 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', - 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', - 'sources': [ - '<(_msvs_precompiled_header)', - '<(_msvs_precompiled_source)', - ], - }], ], }, # v8_initializers { @@ -750,16 +760,9 @@ 'v8_internal_headers', 'v8_libbase', 'v8_shared_internal_headers', + 'v8_pch', ], 'conditions': [ - ['OS=="win"', { - 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', - 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', - 'sources': [ - '<(_msvs_precompiled_header)', - '<(_msvs_precompiled_source)', - ], - }], ['v8_enable_turbofan==1', { 'dependencies': ['v8_compiler_sources'], }, { @@ -780,6 +783,7 @@ 'v8_libbase', 'v8_shared_internal_headers', 'v8_turboshaft', + 'v8_pch', ], 'conditions': [ ['v8_enable_turbofan==1', { @@ -787,14 +791,6 @@ }, { 'sources': ['<(V8_ROOT)/src/compiler/turbofan-disabled.cc'], }], - ['OS=="win"', { - 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', - 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', - 'sources': [ - '<(_msvs_precompiled_header)', - '<(_msvs_precompiled_source)', - ], - }], ], }, # v8_compiler { @@ -809,20 +805,11 @@ 'v8_base_without_compiler', 'v8_libbase', 'v8_shared_internal_headers', + 'v8_pch', ], 'sources': [ '