From 818284b68737bbb9098cf12b1b221cbb24f06ce8 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 | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common.gypi b/common.gypi index 878705a3496e5e..f4cec334c19a5f 100644 --- a/common.gypi +++ b/common.gypi @@ -280,7 +280,11 @@ '-std:c++17' ], '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 413cfd4866ec53..2eab895d31248b 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -327,7 +327,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': [ @@ -675,7 +675,7 @@ ], 'sources': ['<@(v8_compiler_sources)'], 'conditions': [ - ['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': [ @@ -700,7 +700,7 @@ ], 'sources': ['<@(v8_compiler_sources)'], 'conditions': [ - ['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': [ @@ -890,13 +890,15 @@ '