From 512dba6cdf4faa1bdeb8c342d3e7745bb106e78a Mon Sep 17 00:00:00 2001 From: Niyas Sait Date: Tue, 5 Apr 2022 12:29:08 +0000 Subject: [PATCH] build: remove precompiled header and debug information for host builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42538 Refs: https://github.com/nodejs/node/issues/42375 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- common.gypi | 6 +++++- tools/v8_gypfiles/v8.gyp | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/common.gypi b/common.gypi index 3cfed562577978..6bea7720e067cd 100644 --- a/common.gypi +++ b/common.gypi @@ -286,7 +286,11 @@ 'VCCLCompilerTool': { 'AdditionalOptions': ['/Zc:__cplusplus'], 'BufferSecurityCheck': 'true', - 'DebugInformationFormat': 1, # /Z7 embed info in .obj files + 'target_conditions': [ + ['_toolset=="target"', { + 'DebugInformationFormat': 1 # /Z7 embed info in .obj files + }], + ], 'ExceptionHandling': 0, # /EHsc 'MultiProcessorCompilation': 'true', 'StringPooling': 'true', # pool string literals diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index a80778d3fa4662..36073aa9771309 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -342,7 +342,7 @@ '<(V8_ROOT)/src/builtins/builtins-intl-gen.cc', ], }], - ['OS=="win"', { + ['OS=="win" and _toolset=="target"', { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ @@ -706,7 +706,7 @@ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], - ['OS=="win"', { + ['OS=="win" and _toolset=="target"', { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ @@ -733,7 +733,7 @@ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], - ['OS=="win"', { + ['OS=="win" and _toolset=="target"', { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ @@ -905,13 +905,20 @@ '