Skip to content

Commit 3521f8a

Browse files
committed
build,win: limit LTCG only to the main node tagert
1 parent a820580 commit 3521f8a

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

common.gypi

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@
151151
'OmitFramePointers': 'false',
152152
'BasicRuntimeChecks': 3, # /RTC1
153153
'MultiProcessorCompilation': 'true',
154-
'AdditionalOptions': [
155-
'/bigobj', # prevent error C1128 in VS2015
156-
],
157154
},
158155
'VCLinkerTool': {
159156
'LinkIncremental': 2, # enable incremental linking
@@ -229,12 +226,7 @@
229226
]
230227
},
231228
'VCLinkerTool': {
232-
'OptimizeReferences': 2, # /OPT:REF
233-
'EnableCOMDATFolding': 2, # /OPT:ICF
234229
'LinkIncremental': 1, # disable incremental linking
235-
'AdditionalOptions': [
236-
'/LTCG:INCREMENTAL', # incremental link-time code generation
237-
]
238230
}
239231
}
240232
}, {
@@ -258,8 +250,6 @@
258250
'EnableIntrinsicFunctions': 'true',
259251
'RuntimeTypeInfo': 'false',
260252
'MultiProcessorCompilation': 'true',
261-
'AdditionalOptions': [
262-
],
263253
}
264254
}
265255
}

node.gyp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,29 @@
244244
],
245245

246246
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
247-
# Ususaly safe. Disable for `dep`, enable for `src`
247+
# Disabled for `/deps/`, so re-enable for `/src/`.
248248
'msvs_disabled_warnings!': [4244],
249-
249+
'configurations': {
250+
'Release': {
251+
'msvs_settings': {
252+
'conditions': [
253+
['node_with_ltcg=="true"', {
254+
'VCLinkerTool': {
255+
'OptimizeReferences': 2, # /OPT:REF
256+
'EnableCOMDATFolding': 2, # /OPT:ICF
257+
'AdditionalOptions': [
258+
'/LTCG:INCREMENTAL', # incremental link-time code generation
259+
]
260+
}
261+
}, {
262+
'VCLinkerTool': {
263+
'LinkIncremental': 2 # enable incremental linking
264+
},
265+
}],
266+
]
267+
},
268+
},
269+
},
250270
'conditions': [
251271
[ 'node_intermediate_lib_type=="static_library" and node_shared=="true" and OS=="aix"', {
252272
# For AIX, shared lib is linked by static lib and .exp. In the

0 commit comments

Comments
 (0)